Jump to content

javascript issues with for()


Guest BRamburn

Recommended Posts

I mostly use script.aculo.us for my projects that go within IPB.
But the only problem that I see whenever I try to fix IPB's js to work with script.aculo.us is the way IPB use for() function

Somehow if I turn all the:

for(var i in ips_xxx)

to

for(var i=0; i < ips_xxx.length;i++)

AND

typeof

to using typeof with brackets:

typeof(xx)



makes most of script.aculo.us work.

why not use for() completely and use typeof with brackets?


I think that quite a lot of people would be interested in using script.aculo.us on their ipb 2.2 board.
Basically I am asking that the JS should be well formatted so that other javascript plugins cannot interfere with the IPB jscripts.

thanks

Link to comment
Share on other sites

  • Management

why not use for() completely and use typeof with brackets?



I'm really resisting the urge to say "Because we don't want to".

Obviously, such a facetious response is much less than professional. We don't really want to change a lot of our working JS to enable mods to work with IPB - it really should be the other way around. We have good reason to use the "for( var i in array )" construct as we use JSON to maintain hash tables and hash indexes which would be more complex to use in an index looping format as you suggest.
Link to comment
Share on other sites

I'm really resisting the urge to say "Because we don't want to".



Obviously, such a facetious response is much less than professional. We don't really want to change a lot of our working JS to enable mods to work with IPB - it really should be the other way around. We have good reason to use the "for( var i in array )" construct as we use JSON to maintain hash tables and hash indexes which would be more complex to use in an index looping format as you suggest.


Ok then I'll just have to live with it.

BTW why are most of the js script on one line?

thanks
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...