Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Aug 2008
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Javascript Not Showing In IE

    Hello,

    I've been working on the problem on this page for some time now and can't seem to solve it: http://sikhfaith.com/demo/bookmark

    This page loads Javascript to help users bookmark the page. It shows up perfectly in Firefox 2.0. However, in Internet Explorer 7.0, the script apparently never loads and that part of the page remains blank.

    The strange thing is that I had used the exact same script on a differently themed page on a different site, and it showed up perfectly in BOTH browsers that time. So apparently something is amiss just with this particular webpage, not the Javascript itself. But I can't figure out what would block the Javascript from displaying only in IE.

    Any help on this confusing problem would be highly valued. I am no Javascript expert.

    Thank you.

  • #2
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    It's because you did'nt close your comment.
    Code:
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    if (document.all){
      document.write('<A class="blue" HREF="javascript:history.go(0);" onClick="this.style.behavior=\'url(#default#homepage)\';this.setHomePage(\'http://www.sikhism.com\');">');
      document.write('Create Homepage</a>');
    }
    else if (document.getElementById){
    document.write('<a href="http://www.sikhism.com" class="blue">Drag this link onto your Home button to make this your homepage.</a>');
    }
    else if (document.layers){
    document.write('<b>Create Homepage:</b><br>- Go to <b>Preferences</b> in the <B>Edit</B> Menu.<br>- Choose <b>Navigator</b> from the list on the left.<br>- Click on the <b>"Use Current Page"</b> button.');
    }
    else {
    document.write('<b>Create Homepage:</b><br>- Go to <b>Preferences</b> in the <B>Edit</B> Menu.<br>- Choose <b>Navigator</b> from the list on the left.<br>- Click on the <b>"Use Current Page"</b> button.');
    }
    </script>
    See highlighted, you started it, but forgot to close. Also, the correct way for commenting JS for very old browsers is:
    Code:
    <script type="text/javascript">
    <!-- // Begin Comment
    JS syntax here
    // End comment -->
    </script>
    Also note that language is a deprecated attribute. Use type (highighted in red) instead.

    Hope that makes sense.
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph

  • Users who have thanked rangana for this post:

    ssstack (08-09-2008)

  • #3
    New to the CF scene
    Join Date
    Aug 2008
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts
    You are awesome and solved my problem. Thanks. It was so simple but because I did not know I had been spending my time looking elsewhere for the issue.


  •  

    Posting Permissions

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