简体   繁体   中英

Input type image does not work in Internet Explorer, though works in Chrome and Firefox

I can't figure out why the following input does not work in IE. I also tried type="button" as well and it doesn't work either.

<input type="image" src="/images/150x200.png" alt="Profile" onClick="window.open('http://www.genericname.com/blah.aspx','Blah - Blah Blah','width=790,height=600,resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no')" />

My goal is to have a new window open up as a pop-up upon clicking the button.

I need to know if this is a known bug. If so, I will need to find another solutions. Any suggestions are welcome.

The problem is that the window name you're using, "Blah - Blah Blah", is going to make IE unhappy. It should look like an identifier (no spaces, and I think no "-" either).

You should be getting an error Invalid Argument in IE and thats why it is not opening, because Window,open() doesn't like spaces characters passed to window,open(). If you get rid of spaces betwwen blah blah blah, it will work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM