www.webdeveloper.com
Results 1 to 5 of 5

Thread: Inherited JS Code Not Working in IE9

  1. #1
    Join Date
    Nov 2011
    Posts
    2

    Inherited JS Code Not Working in IE9

    I inherited a website where the previous web designer installed a slideshow javascript code to "feature" products. It works fine in all browsers and IE8 and lower.

    However, IE9 and up, it's not working at all. I don't know anything about JS so I'm at a loss as to what the problem is or what could be causing it. I tried contacting the original creator of the JS code at CoolWebDeveloper, but his last post was in 2009 so I'm not expecting much back on that.

    The owners of the site use IE9, and IE exclusively for that matter, so they think that the slideshow isn't working ever for anyone coming to the site and are very anxious to get it fixed. I've read that IE9 reads and interprets Java differently than older browsers but with my non-JS knowledge, that doesn't help me much.

    I don't want to post the entire code, as guidelines suggested I not, but I don't know what part of or where in the code the problem is coming from. The site is:

    http://securitystore.com/

    I also searched on the forums here and, forgive me if I missed it, but I did not see anything right off that would help.

    I appreciate any and all help/suggestions - thanks very much for your time.

  2. #2
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    Your js file slider.js has 3 lines of codes (first 3 lines) which are wrong
    Code:
    <script src="http://ie.microsoft.com/testdrive/HTML5/CompatInspector/inspector.js"></script>
    <!-----------To download a fresh copy of code, and for more code downloads and content --------->
    <!-----------please visit www.coolwebdeveloper.com-------->
    1. You can not load an external js file from within another js file
    2. The <!-- --> comments are HTML comments (and note that they must have only two -- characters on both open and close), not JavaScript comments, thus inserted in a JavaScript code might bring errors, especially under an XHTML Doctype. Anyway, as there is an external code, those comments are definitely wrong there. JavaScript accepts only the // (one line) and /* */ (multi line) comments

    Furthermore, in your main HTML document:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" xmlns="http://www.w3.org/1999/xhtml"><html><script type="text/javascript"> 
     <!-- 
     (new Image).src="http://store.yahoo.net/cgi-bin/refsd?e=http://www.thesecuritystore.com/&h=www.thesecuritystore.com&v=1.0&dr=" + escape(document.referrer); 
     --> 
     </script>
    <head>
    1. Embedded javaScript codes must be written either inside the HEAD section or inside the BODY section. That code is written outside any of them
    2. The <!-- --> comments are HTML comments, not JavaScript comments. See my explanation above.

    Quote Originally Posted by skatoolaki
    I don't know anything about JS
    In this case you should not have settled down to a job about you know nothing. Either you learn JavaScript or you hire a professional.
    Last edited by Kor; 11-08-2011 at 06:07 AM.

  3. #3
    Join Date
    Nov 2011
    Posts
    2
    The problem has been fixed, and thanks for the help but no one asked for your opinion. I am a professional and knowing JS was not (and is not) part of the job description and the problem was that the past developer had put something in that did not work and was no longer valid on newer versions of most browsers. We fixed that and have something that works even better.

    As for "settling down into the job", I've been here half a year and have been hired on permanent and full-time and have also taken over their other website, so apparently knowing HTML and CSS - which is all that we need for these sites - appears to be just fine for my employers (as I knew it was - I told them what I knew and what I didn't when I was hired, btw).

  4. #4
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    Quote Originally Posted by skatoolaki View Post
    The problem has been fixed, and thanks for the help but no one asked for your opinion.
    Once you have posted a problem in a Forum, you have asked for an opinion. My opinion, others' opinion, it does not matter.

    On the other hand, when you say "I don't know anything about ...", you give yourself no chances to get a solution. Either you know at least the basis of a language, or you ask a friend or an employee for a solve.

  5. #5
    Join Date
    Jan 2011
    Posts
    117
    I don't know why - but I totally agree with Kor's "opinion".

    If knowing javascript is >>not<< in your job description - and if not knowing any javascript "appears to be just fine for your employers" - why should "you" bother us with "their" javascript problems which inherently are not "your" problems either, and also get mad about, if someone points it out to you?

    But we're glad you solved it anyway.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles