Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help: window.open() not working in IE8 1

Status
Not open for further replies.

invalid4564

Programmer
Jul 13, 2010
16
US
I'm trying to open a new window to show a contact form but it is not working in IE8. When i open the website in firefox and click on the link, it works perfectly.

How can i fix my code so it also works in IE8?

JavaScript:
<div styles="width:70px;height:30px;font-family:arial;font-size:12px;color:#000000;text-align:center;">
Email:<a href="javascript:location='[URL unfurl="true"]http://www.currentpage.html';window.open('http://www.nextpage.html','Contact[/URL] Agent','height=700,width=490,
scrollbars=yes,resizable=no')">agent@website.com</a>
</div>

Thank you for your help.
 
Your window name has a space character in it ('Contact Agent'). This can cause issues with some browsers.

Remove the space and try again.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Snippets & Info:
The Out Atheism Campaign
 
In fact, this makes perfect sense if you read the specs. Given the second parameter is the window name (which can be used to target the window via the TARGET attribute), it should probably have the same naming rules as the "name" attribute, which can be found here:

W3C said:
ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").

So basically, no spaces.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Snippets & Info:
The Out Atheism Campaign
 
Success...I removed the space and it worked.

Thank you very much everybody for your help.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top