Author Topic: comment in javascript block  (Read 5596 times)

buggyfunbunny

  • Senior Community Member
  • Posts: 233
  • Hero Points: 4
comment in javascript block
« on: June 22, 2007, 12:31:43 PM »
Sometimes, but not always (the part I'd like to figure out), 12.0.1 *doesn't* show code inside the javascript tags (where the protect against disabled javascript <!-- --> syntax is used) as just comments.  Tagged and all.  Other times, it's just comments.  Files I've seen this with are .xhtml (jsf) and .jsp.  They're setup to refer to .html.  I didn't see in the readme anything about this.

Dennis

  • Senior Community Member
  • Posts: 3961
  • Hero Points: 517
Re: comment in javascript block
« Reply #1 on: June 22, 2007, 02:06:00 PM »
I have no idea what you are talking about.  Could you please supply an example?

buggyfunbunny

  • Senior Community Member
  • Posts: 233
  • Hero Points: 4
Re: comment in javascript block
« Reply #2 on: June 22, 2007, 08:54:21 PM »
sure:

    <script type="text/javascript">
    <!--
   
      /**
       *  This function is called automatically after the page body
       *  has completed loading.
       */
      function onLoadMain()
      {

        setTableHeight();;
      }
      
         -->
    </script>

in an .html (or derived) file should be tagged and color coded as functions.  Sometimes they, sometimes they're not.  If the html comment delimiters are removed, tagging/coloring always works.

Dennis

  • Senior Community Member
  • Posts: 3961
  • Hero Points: 517
Re: comment in javascript block
« Reply #3 on: June 22, 2007, 09:12:14 PM »
OK, that helps a little.

By default, .xhmtl is referred to XML.  Unfortunately, we do not support embedded language modes in XML (since you could define any tag, not just script, or script could mean something completely different).  Yes, XHTML, should be a special case, but that's not there yet.  Anyway, this could be the case where you see the contents of the script colored as comments instead of as JavaScript.  So please double check that you have xhtml referred to html.

You shouldn't see any problems with this in JSP, since that is by default treated as HTML.  If you see a JSP that exhibits this problem, I suspect, I'm going to need a complete example in order to debug the problem.

By "sometimes they are colored", do you mean that in certain situations, the one script tag is color coded as comments and another is color coded as JavaScript, or that the *exact same* script will get color coded as comments one time you look at it and as JavaScript another time?

buggyfunbunny

  • Senior Community Member
  • Posts: 233
  • Hero Points: 4
Re: comment in javascript block
« Reply #4 on: June 23, 2007, 02:16:37 AM »
By "sometimes they are colored", do you mean that in certain situations, the one script tag is color coded as comments and another is color coded as JavaScript, or that the *exact same* script will get color coded as comments one time you look at it and as JavaScript another time?

The former.  And the note that .xhtml is by default referred from .xml may answer the question.  At some point I noticed that, and changed it to .html.  For existing workspaces, where the .xhtml files were open, they may be the ones still in comment/untagged.  It's likely that .xhtml files opened since I changed the refer are OK.  Not in CubeLand now.  Will check when I get there.