• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

threading in javascript

 
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 79180
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you tried the Javascript forum?

I don't think there is, no.
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Campbell Ritchie:

I don't think there is, no.



+1
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why do you ask?
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the complete answer.
 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are writing your own animation engine?
 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
so IE wont proccess .php scripts?

Justin
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic