BUG? really strange problem in http server

Discussion to talk about software related topics only.
Post Reply
jleni
Posts: 15
Joined: Tue Nov 18, 2008 5:50 am

BUG? really strange problem in http server

Post 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
User avatar
Forrest
Posts: 286
Joined: Wed Apr 23, 2008 10:05 am

Re: BUG? really strange problem in http server

Post 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.
Forrest Stanley
Project Engineer
NetBurner, Inc

NetBurner Learn Articles: http://www.netburner.com/learn
jleni
Posts: 15
Joined: Tue Nov 18, 2008 5:50 am

Re: BUG? really strange problem in http server

Post 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...
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: BUG? really strange problem in http server

Post by rnixon »

How about just using a different variable name, like you did with zz? That way you can still use compression.
Post Reply