This week's giveaway is in the JDBC forum.
We're giving away four copies of Java Database Connections & Transactions (e-book only) and have Marco Behler on-line!
See this thread for details.
Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

threading in javascript  RSS feed

 
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey, is there a way to do threads in javascript???

Thanks,

Justin
[ September 08, 2007: Message edited by: Bear Bibeault ]
 
Marshal
Posts: 64496
225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried the Javascript forum?

I don't think there is, no.
 
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Campbell Ritchie:
Have you tried the Javascript forum? ...


Moving...
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Campbell Ritchie:

I don't think there is, no.



+1
 
Sheriff
Posts: 67261
170
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to take the time to compose descriptive subjects for your posts; read this for more information.

I have adjusted the subject of this post for you.
 
Bear Bibeault
Sheriff
Posts: 67261
170
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you ask?
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A similar question in me arose. Will be onreadystatechange functions caused consecutively, or in parallel? To sense it brings down parameter "async" of method XMLHttpRequest.open.
[ September 09, 2007: Message edited by: Andrey V. Ovcharenko ]
 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please have a look at Ajax and javascript don�t use threads
 
Andrey V. Ovcharenko
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the complete answer.
 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the reason i ask is. I like doing functions that put stuff in motion and change sizes... but you can only do one at a time. so i was wondering how to make the different javascript functions run parallel instead of in an iterative manner.

Thanks,

Justin
 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
also, instead of using different alignment parameters. I've been using div's and just putting what i need at a different spot on the web page in the div and defining the x,y coords of the div. is this ok? or should i be doing something else?

To me this is a lot easier than using tables or other things of that sort.
and what is the type="" for a textarea form?

<form type = " " width = " " height = " " ><center> text </center> </form>

Thanks,

Justin
 
Bear Bibeault
Sheriff
Posts: 67261
170
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are writing your own animation engine?
 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
its an animation i guess, i dont know about an engine.

i just have a square getting bigger and then text shooting in from the side
but i dont have two separate functions, one for the box and one for the text like i want, i have to put it all in one function. Thats why i was wondering about threading.

Justin
 
Bear Bibeault
Sheriff
Posts: 67261
170
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To do that right you've got to let the JavaScript interpreter get control between frames of the animation, rather than running it in a tight loop.

Rather than building something from scratch, I'd recommend using the animation features of a package like jQuery or Scriptaculous (recommend the former over the latter).

They know how to do animation, and you won't end up with "threading" problems.
 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

To do that right you've got to let the JavaScript interpreter get control between frames of the animation, rather than running it in a tight loop.



what do you mean? could you give me an example (code wise).

Thanks,

Justin

not that i prefer to do it myself, but i like to learn
 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
its hard to believe that java would make a script language with almost all the functionality of java, but no threadsd?

need to update

Justin
 
Rancher
Posts: 43009
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Justin Fox:
its hard to believe that java would make a script language with almost all the functionality of java, but no threadsd?



Java and JavaScript share just about nothing but part of the name and a similarity in syntax. Beyond that, they're very different beasts; you're not the first to be confused by that.
[ September 11, 2007: Message edited by: Ulf Dittmer ]
 
Bear Bibeault
Sheriff
Posts: 67261
170
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Ulf Dittmer:
Java and JavaScript share just about nothing but part of the name



Indeed. JavaScript was not "invented by java" or Sun for that matter. It's an implementation of ECMAScript that was created by Netscape back when Java was a hot buzzword. They figured JavaScript sounded a lot more market-zingy than ECMAScript.

And JavaScript is far far far far, very far, from "almost all the functionality of java". Not even close.

That said, the mechanics of timers and animation are a bit on the complex side to go into in a forum reply, but you should be able to find resources on the web.
[ September 11, 2007: Message edited by: Bear Bibeault ]
 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
alright, thanks for the help, and the history check lol, good to know what im talking about now .

im confused... is PHP better than javascript? I've been using a beginners javascript book, and it goes straight into getting objects of form styles and manipulating the data entered/size of the forms.

and PHP just talks about how to create functions, and a good bit of time on crazy array functions. and I think it said something about apache? what is apache and is it a neccessity to run PHP scripts?

i havent gone very far in the PHP book, but about as far as i have in my little javascript book, and it seems they are geared towards totally different things(as far as right now).

can you do similar fucntions in PHP as in javascript? Such as:


different sytax ofcourse, but same idea.

Thanks again,

Justin
 
Bear Bibeault
Sheriff
Posts: 67261
170
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Justin Fox:
im confused... is PHP better than javascript?

That's rather like asking which is better: the steering wheel or the brakes?

php is just a server-side templating language to create HTML and JavaScript pages to send to the browser. In that respect it's a lot like JSP. php is not a JavaScript replacement or competitor.

and PHP just talks about how to create functions, and a good bit of time on crazy array functions

All of which is server-side activity.

what is apache and is it a neccessity to run PHP scripts?

Apache is a web server. It has a module that processes php.

and it seems they are geared towards totally different things(as far as right now).

It is. See above.
 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so IE wont proccess .php scripts?

Justin
 
Bear Bibeault
Sheriff
Posts: 67261
170
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Justin Fox:
so IE wont proccess .php scripts?

No. As I said, php is processed on the server, not on the client.
 
Make yourself as serene as a flower, as a tree. And on wednesdays, as serene as this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!