views:

98

answers:

2

Hi, I'm wondering if someone can point me in the right direction. I've got an ASP.NET web application. And there's autogenerated portion of JavaScript in every page that handles postback. Sometimes that javascript is surrounded by

<[CDATA[ ... ]]>

, while on the other machine it may be enclosed in simple HTML comment like

<!-- ... -->

So, I'm searching for an answer or a clue about what may cause this difference. Any ideas?


Answer:

The cause is version of .Net framework. Was hard to find because I used installer to setup everything, from web server to framework and application sources. Not very obvious line in httpd.conf caused latest framework to be used.

Story behind: MS changed JS generation from version 2.0 sp1 to use CDATA.

Thanks for replies.

A: 

My guess is that it is not the machine that matters but the user's browser that may be different. Javascript will be rendered differently for "down-level" browsers which do not support Javascript. So, the JS section will be enveloped by an HTML comment tag.

Cerebrus
I can use the same browser for both machines. I can even view pages of same web app from one machine. Result is still the same: comments are different.
clorz
A: 

You didn't said about what do you mean by different machine. If different machine is used for web server, then it's because of .NET framework version. As I recall, prior to .NET2.0sp1 CDATA wasn't used.

PiRX
Different machine means two web servers with same web app..Net version looks like the right cause. Trying to verify...Thanks!
clorz