Results 1 to 7 of 7

Thread: Problem with html style comments in ie7

  1. #1

    Default Problem with html style comments in ie7

    Hello,

    I have a JSP with Ext.onReady() function. I have a html style comment within this function. I noticed that due to this, the page does not get rendered in IE 7. When I change the HTML style comment (<!-- comment -->) to JSP style comment ( <%-- comment --%>), it works. Any reason for this behaviour. Please let me know.

    Thanks,
    Sandhya

  2. #2
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    Well it's not valid Javascript syntax is it?

    Javascript commenting is the same as Java.

  3. #3

    Default

    Thanks for the reply. You mean I can use only JSP style comments (<%-- --%>) within Javascript ? Firefox does not complain though.

  4. #4
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    I said Java, not JSP

    // is a comment in javascript

    /* is a comment in javascript */

  5. #5

    Default

    Thanks. The JSP style comments work too but may not be the right way.

  6. #6
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    Depends what you want to actually happen.

    JSP style comments are for people who maintain the JSP. They won't go into the final page because the JSP processor discards them.

    If you use Javascript style commenting in your scripts in the page, they will end up in the final page, and so they can be read if people do "View Source", or if they debug the page in the browser.

    It's up to you.

  7. #7

    Default

    Yes..My concern is just that even the html style of comments works in firefox (though this is not the right way as you say) but IE 7 fails to render the JSP.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •