PDA

View Full Version : Code works fine in FF but not at all in IE



boxxer03
Mar 6th, 2007, 08:59 PM
I have a function on one of my pages that you can click on to open up information from a .js file and it displays it in a pop up - I know there are better ways of doing this, but thats not the point. The problem is it works fine in Firefox and everything else, excluding Internet Explorer... surprise surprise. It doesn't bring up any errors at all in Firefox but IE hates it. Here's the basics of the code:

this calls the .js file:


<script type="text/javascript" src="scripts/rescues.js"></script>


this is the code i use to load the window with the specific information:


<a href="javascript: showRescInfo(rescue30);"><i>View Full Information</i></a>


I'm trying to post as little as possible of the code here, so if you need anymore just let me know. You can check out the page at: http://savepitbulls.8m.com/rescues.html
I just don't get why it would be absolutely fine in Firefox, and Netscape but IE hates it. All the other javascript functions work fine on the page and putting ' ' around the rescue30 portion of the code, so it looks like - ('rescue30') only causes it to claim that everything is undefined.

I'm sure i'm missing something stupid, so can someone please give me a hint here?

glenngv
Mar 6th, 2007, 09:08 PM
I think the error is in the window.open line in showRescInfo() function. IE doesn't allow spaces and other special characters in window target which is the 2nd parameter of window.open. It throws invalid argument error. Replace the space with underscore or remove it.

var rescInfo=window.open('','Rescue_Information','......');

boxxer03
Mar 6th, 2007, 09:27 PM
nice call. i took it out and it works fine now. haha, i told you it was something small i missed. thanks a lot!