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

    JavaScript "Object" Error Preventing Page from Displaying Properly?

    I have been working on a web site at http://olomcc.org and for the most part it is rendered properly but for some reason when viewing with IE 8 from work it does not. I believe it is due to four separate JavaScript functions called from an external js file but I cannot seem to figure out the problem. The functions simply use the 'document.write' method to add some HTML to the document; nothing fancy. I've attached a screenshot of the faulty rendering as well as a screenshot of the scripting errors using IE's debugging feature.

    I am quite new to scripting and have read many articles to no avail.

    Thank you.
    Attached Thumbnails Attached Thumbnails JavaScript "Object" Error Preventing Page from Displaying Properly?-olomcc.org.jpg   JavaScript "Object" Error Preventing Page from Displaying Properly?-olomcc.org.errors.jpg  

  • #2
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Thanked 557 Times in 554 Posts
    well, the first thing is that IE 8 on my machine renders the page fine - nothing like your screenshot.

    the second thing is that document.write() is very obsolete and it is worth investigating another way to do this.

    the third is that you have html commenting within your document.write statement. Document write is javascript, so it could be that this is confusing the code. Have a look here, from your headingtoplev1 function:

    document.write("<a class='mainlink' href='index.html'>HOME</a> <strong>|</strong> <a class='mainlink' href='http://olomcc.org/wordpress/' target='_blank'>BLOG</a> <strong>|</strong> <a class='mainlink' href='http://olomcc.org/phpbb3/' target='_blank'>FORUMS</a> <strong>|</strong> <a class='mainlink' href='http://ex.myhosting.com/owa/' target='_blank'>WEBMAIL</a> <strong>|</strong> <a class='mainlink' href='http://m.olomcc.org' target='_self'>MOBILE</a> <!-- <strong> | </strong> <a class='mainlink' href='https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HH6JDEH97EYJN' target='_blank'>ONLINE TIDE</a>-->")
    everything between the <!-- and the --> (the ONLINE TIDE link) is commented out , so it will never get rendered anyway. You are basically saying to the js "make this part of the page" and then later, to the html "ignore this bit". I would suggest removing all of that and seeing if the situation improves


    Posting Permissions

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