Jump to content

Invalid Argument


ThePsion5
 Share

Recommended Posts

I have the following snippet of code from a javascript function that I call as follows on my page:

<a onclick= popupRelated("related.php?id=5&field=keywords&name=SomeKeyword")>Random</a>

Now, in Firefox this works perfectly, but It breaks in IE. I get the following error:

Line: 4Char: 1Error: Invalid Argument.Code: 0Url: (the current page)
can anyone tell me what's going on? My actual javascript function is here:
function popupRelated(url){window.open(url,'Related Items', 'width=640,height=480,scrollbars=no,resizable=yes,status=no,toolbar=no,menubar=no,location=no');}

EDIT:I tried replacing the single quotes with double quotes in my window.open method like so:

function popupRelated(url){window.open(url,"Related Items", "width=640,height=480,scrollbars=no,resizable=yes,status=no,toolbar=no,menubar=no,location=no");}

but to no avail. :) Any ideas?

Link to comment
Share on other sites

<a onclick='popupRelated("related.php?id=5&field=keywords&name=SomeKeyword")'>Random</a>function popupRelated(url){	window.open(  url,  'RelatedItems',   'width=640,height=480, scrollbars=no,resizable=yes,status=no,toolbar=no, menubar=no,location=no'	);}

Edit: Just tidying up the last line.. it was too long so the forum was outputting the char code instead of '. The Related Items should be one word :)

Link to comment
Share on other sites

I tried reformatting my HTML code like so, but with no luck:

<a onclick="popupRelated('related.php?id=13&field=keywords&name=test%20link%203')">

I also tried the reverse where i enclosed the function in single-quotes and the URL in double quotes with the same result. Stupid IE! I have it set up the way that the W3Schools Tutorial has it set up, I don't see why it wouldn't work...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...