JQuery Code not Working on IE8

Posted on 2012-03-27
Medium Priority
Last Modified: 2012-04-12
Hello again all!

After some much needed help from an expert, I finally got some Javascript (JQuery) I was working on going in Firefox and Chrome. I go to test in the world's "best" browser, IE8 and it doesn't work at all. Here is the code.
<script script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
$(function() {
     $("#PrinterNames").change(function() {
         var printer = $(this).val();
        var url = "file:///C:/Users/JBenson/Desktop/Printer Scripts/Completed" + "/" + printer +".vbs";
        window.open(url,'Start Installation');


<body lang=EN-US style='tab-interval:.5in'>

<img src=inspirelogo.gif>

<h2>Welcome to the HK Printer Installation Page!</h2>
      <h3>Please select a printer:
            <select id ="PrinterNames"  name ="PrinterNames" >
		  <option value="Please Select a Printer" selected="selected">Please Select a Printer</option>
		  <option value="Acadia">Acadia</option>
                  <option value="Altima">Altima</option>
                  <option value="Armada">Armada</option>
                  <option value="Avalon">Avalon</option>
                  <option value="Blazer">Blazer</option>
                  <option value="Camaro">Camaro</option>
                  <option value="Caravan">Caravan</option>
                  <option value="Cavalier">Cavalier</option>
                  <option value="Celica">Celica</option>
                  <option value="Charger">Charger</option>
                  <option value="Chevelle">Chevelle</option>
                  <option value="Corolla">Corolla</option>
                  <option value="Corvair">Corvair</option>
                  <option value="Corvette">Corvette</option>
                  <option value="Daytona">Daytona</option>
                  <option value="Envoy">Envoy</option>
                  <option value="Escalade">Escalade</option>
                  <option value="Frontier">Frontier</option>
                  <option value="HHR">HHR</option>
                  <option value="Hummer">Hummer</option>      
                  <option value="Impala">Impala</option>
                  <option value="Insight">Insight</option>
                  <option value="Intrepid">Intrepid</option>
                  <option value="Journey">Journey</option>
                  <option value="Malibu">Malibu</option>
                  <option value="Maxima">Maxima</option>
                  <option value="Murano">Murano</option>
                  <option value="Neon">Neon</option>
                  <option value="Nomad">Nomad</option>
                  <option value="Nova">Nova</option>
                  <option value="Prowler">Prowler</option>
                  <option value="Sentra">Sentra</option>
                  <option value="Skyline">Skyline</option>
                  <option value="SSR">SSR</option>
                  <option value="Stratus">Stratus</option>
                  <option value="Versa">Versa</option>
                  <option value="Xterra">Xterra</option>
            </select> </h3>

<h3>Steps for Printer Installation </h3>
      <li>Select your printer from the drop down above.</li>
      <li>You will get a pop up window that looks like this<br>
      <img src="printerinstall.jpg" alt="Download Box" ><br>
      Please click on open. It will iniate the installation.<br></li>
      <li>You may see a pop up box that looks like this during your installation<br>
      <img src="trustprinter.jpg" alt="Trust Printer"><br>
      Click on Install driver. <br></li>
      <li>After a few minutes, check your Devices and Printers and the printer you selected should now be there.</li>
<h3>Please contact the helpdesk at 6657 if you encounter any issues. </h3>


Open in new window

I ran it through a fiddle someone created for me, and jslint on that doesn't find a single error. It runs great on Firefox and Chrome. Downloads a file I need the second I click on it.

I hate to be such a bother, but anyone have any ideas? Any reason IE would be so extremely picky?

I have also included a script file so if you wanted to test it in IE, you could.

Thanks Jami
Question by:JamiBenson092279
  • 5
  • 5
LVL 75

Expert Comment

by:Michel Plungjan
ID: 37774968
Is this for an intranet?
Where does the HTML live? On a web server or hard disk? Is the vbscript supposed to live on the hard disk?
I am frankly amazed it runs on any browser since it is highly suspect to execute a local script file.
Try the following:
1) put the web server the page runs on in trusted zone if that does not help,
2) save the html to hard disk and give it extension .hta for HTML application
LVL 75

Expert Comment

by:Michel Plungjan
ID: 37775126
Very simple solution

Remove the space in the window name parameter


Author Comment

ID: 37776530
It is being tested on my local hard drive at the moment, but will actually run on a server once it is actually working like it's supposed to.  It all is just sitting on my desktop at the moment.  It is for our intranet yes.

I must have copied and pasted wrong since there is no space in the window name parameter.
 I tried changing it to hta as you had suggested. I get the same issue, It won't start the download. As a note, it was giving me an issue with the line(line 9 character 9) about opening a Window. I took it out and received the same issue as before.

Can you make any other suggestions?

Thanks for your time.
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

LVL 75

Expert Comment

by:Michel Plungjan
ID: 37777074
Yes there is

window.open(url,'Start Installation');

Remove the space from after the word start

Author Comment

ID: 37777161

I now see that and apologize for not seeing that. I added the underscore. I am truly sorry apologize for that oversight and am sorry to have not seen that issue sooner. I will not make glaring mistakes like that again and then expect someone to correct them.

Even after making the changes you suggested it isn't working like it does in Firefox and Chrome. It pops up a window, like the jquery is telling it to, but it doesn't bring up the download box. I know IE, especially IE8, is very picky about syntax. Is there some reason that it would achieve the expected result in other browsers and not IE? Do I need to try different code instead to achieve the result I desire platform wide?

Thanks again and so sorry for my stupid, erroneous mistake.
LVL 75

Expert Comment

by:Michel Plungjan
ID: 37777323
No worries that can happen
I get the vb files in the browser as plain text in Firefox. No attempt of execution.
In ie8 I get a download or open dialog

This is on xp service pack 3

Seems that is the direct opposite of what you get

Author Comment

ID: 37777344
That is odd!! I am using Windows 7 32 bit.

So very weird.....  

Is there a better way to do what I am trying to that may be more tolerant across all platforms? I originally was going to use an on click event to trigger the download, but I didn't know how to pass the value of the drop down box to the event. Do you think that I might be better off going this way?

Thanks again! Sometimes web programming and I just don't get along!

LVL 75

Accepted Solution

Michel Plungjan earned 2000 total points
ID: 37777978
I just wrote this for another problem

Is that worth a try?


Author Comment

ID: 37839589
I really have to apologize about not getting back to you all about this. I could never get it to work so I tried something else similar and it works..... somewhat. We have been so busy the last couple weeks, I just haven't gotten the time to do anything.

I appreciate all the help you gave me though!


Author Closing Comment

ID: 37839594
I never actually got this working, but you get the points for trying to help the noob! Thanks again!

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question