Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: <script> blocks not triggered if they contain comments

  1. #11
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    6,956

    Default

    That would work fine. The <!-- works fine within the standard document because the js enabled browsers discard it. Dynamically loaded scripts are regex'ed and evaled so they have to be valid JS.

    I could strip them out, but I'd rather not add the overhead if it isn't needed. You may want to override that method and add in the 1 liner to strip the "<!--" if you can't remove it from the JS source.

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

    Default

    Quote Originally Posted by alanwilliamson
    Quote Originally Posted by Animal
    That is old stuff. <script> is part of HTML4.
    okay, but don't you need to use CDATA if you technically want it to pass XHTML compliance?
    Well, a CDATA sectino will probably be required because your script code might contain characters which XML uses... like if you do a "greate than" test. But "<![CDATA[" isn't valid javascript, so you must comment that

    I'm loading dynamic content as xhtml just to test the xhtml generation capabilities of my JSP tags. IE7, and FF2 parse my loaded content as XML.

    I output

    Code:
    <script type="text/javascript">//<![CDATA[
    At the beginning and

    Code:
    //]]></script>
    at the end.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Delete key not triggered by Keymap
    By mabushadi in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 3 Feb 2007, 1:53 PM
  2. Zoom In/Zoom Out Animation Comments Tutorial and/or Samples
    By Bobafart in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 29 Dec 2006, 5:36 PM
  3. "Popup" Window like Site Comments Box
    By drayru in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 14 Oct 2006, 12:09 AM

Posting Permissions

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