Page 1 of 1

BUG? really strange problem in http server

Posted: Thu Jan 01, 2009 7:28 pm
by jleni
I know this is extremely strange. But my javascript code is modified if I get a web page from sb72ex.

The webpage that is used in the board contains the following line:

for (var i=0; i<16; i++)
{
var divName="#divfaultbit"+i;
mask=1 << i;
... etc ...

This code was test on local computer and was working perfectly. When used in the device was not working. We detected that the code that was send was exactly the same, but a variable was in uppercase

for (var i=0; i<16; i++)
{
var divName="#divfaultbit"+i;
mask=1 << I;
... etc ...

Note how i was turned into I. This obviously breaks the javascript code. We decided to change i into zz and now the code is working correctly. Any clue why is this happening?
I am afraid this may break any other javascript code we include there...
Thanks

Re: BUG? really strange problem in http server

Posted: Mon Jan 05, 2009 2:35 pm
by Forrest
The html compiler converts some source to all uppercase in the comphtml stage of the project build. If you need case specific code, disable comphtml compression.

To do this, right click on your project and select Properties. Under C/C++ settings, navigate to NetBurner CompHTML. Click on the NetBurner tab and check the "no compression" option. Click OK, and then do a clean of your project. Rebuild and reload onto the NetBurner. See if this resolves your javascript issue.

Re: BUG? really strange problem in http server

Posted: Tue Jan 06, 2009 6:43 am
by jleni
I think this should be corrected as javascript is case sensitive, and I don't want to miss the compression feature..
Using javascript in webpages it is not something unusual...

Re: BUG? really strange problem in http server

Posted: Tue Jan 06, 2009 2:50 pm
by rnixon
How about just using a different variable name, like you did with zz? That way you can still use compression.