SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot capnhud's Avatar
    Join Date
    Nov 2005
    Posts
    141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Commenting Out Javascript

    I tried to get this to validate but what is the proper way to comment out script

    I tried this but it does not seem to comment out the script
    <!--<script type="text/javascript">-->
    <!--
    Your script
    -->
    <!--</script> -->
    I know I am in my own little world. But its OK "They Know Me HERE"

  2. #2
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,109
    Mentioned
    28 Post(s)
    Tagged
    2 Thread(s)
    From within the script block..

    Code:
    /*   A block comment
    asdf
    asdf
    asdf
     */
    
    // Single line comment

  3. #3
    SitePoint Zealot capnhud's Avatar
    Join Date
    Nov 2005
    Posts
    141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So it should be:
    <script type="text/javascript">
    /* Your script */
    </script>

    and not
    <!--<script type="text/javascript">-->
    <!--
    Your script
    -->
    <!--</script> -->
    I know I am in my own little world. But its OK "They Know Me HERE"

  4. #4
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,109
    Mentioned
    28 Post(s)
    Tagged
    2 Thread(s)
    That'll do

  5. #5
    SitePoint Zealot capnhud's Avatar
    Join Date
    Nov 2005
    Posts
    141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes that did the trick
    I know I am in my own little world. But its OK "They Know Me HERE"


Bookmarks

Posting Permissions

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