Hi Nidhi,
sorry for being a bit late with my respond.
I did try your suggestion amongst other things.
Here are two other options:
1: Which uses // style javascript comments instead of /* ... */
!
I suspect the result is exactly the same as nidhi's suggestion in all browsers
2: Which use of simple html style comments (and a javascript // comment):
!
I've seen this method used and suggested somewhere - and sometimes in combination with CDATA tags, but I don't really understand why it works, and it's probably also a kind of legacy approach to hide javascript from incompatible browsers.
3: The 'catch-all' bulletproof approach
!
I suppose it'll work. But as the author states:
"Remember that the very concept of sending XHTML to be handled by an HTML engine is essentially a hack and cannot be done flawlessly."
Source:
http://www.webdevout.net/articles/esc...For me the first approach did the trick in the major browsers.
Thanks, nidhi
Add New Comment