Forum Moderators: open

Message Too Old, No Replies

Setting Priority

Does Anyone have experience with setting priorities in javascript

         

trifi

10:54 pm on Nov 25, 2003 (gmt 0)

10+ Year Member



I believe it is possible to set priorities for a function in javascript, does anyone have any experience with this. Before I dive into playing with the concept I wanted to know how browsers respond to this, because the whole concept doesn't seem to reliable to me since you cannot access the client's machine; the browser retains this info.

DrDoc

11:39 pm on Nov 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not quite sure I understand what you're talking about...
Set priorities for what? One function having a higher priority than another?
There's not multitasking in JavaScript, but everything is run in the order it is called.

Maybe a more concrete description can help me understand what you're getting at...

trifi

12:00 am on Nov 26, 2003 (gmt 0)

10+ Year Member



sorry about being unclear...I have read that you can set Priorities to functions. Also I know there are javascript keywords like getPriority which will return you a value ranging from 1 (highest) to 5 (lowest). I wish I could put the link to an article here but if you type "javascript API Reference setPriority" it should come up. Is this true or am I just not understanding the meaning?

DrDoc

3:03 am on Nov 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ok, now that makes a lot more sense... But it's unrelated to the normal JavaScript use on a traditional Web page.

JavaScript is in itself incapable of multitasking. A running process/function has top priority for as long as it runs. Only one JavaScript process can run at a time.

trifi

4:20 am on Nov 26, 2003 (gmt 0)

10+ Year Member



So you can not setPriority to a function. For instance if I were to do a setTimeOut Loop with many objects from an array passing through the loop(numerous times until the opacity of each object was 0 coming down from 100) could I setPriority to this function. I do not want the function to return to where it was called until the opacity is 0.

DrDoc

3:43 pm on Nov 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You don't need "setPriority" to do that. You can just write your JavaScript function that way.