开发者

Why does this JavaScript destroys my layout in Internet Explorer?

I'm using a small CMS for a small site (http://www.ovlu.li/cms/). There I include a JavaScript on the first site to open an image in a popup:

<script type="text/javascript">
function pop(file)
{
helpwindow = window.open(file, "Vaterland", "width=600, height=796",  "directories=no", "toolbar=no", "location=no", "status=no", "menubar=no", "resizable=no");
helpwindow.focus();
return false;
}
</script>

This works fine in FireFox, Chrome and Safari, b开发者_Go百科ut unfortunately, in Internet Explorer this script totally destroys the layout of the site where it is contained. Nevertheless it works. And all other sites are also working correctly. Any hints?


I think your main problem is that the script is located before <html>. It should be inside of <head>.

Other than that, your javascript is wrong. The third parameter is features. Instead, you're passing features as a heap of paramters, divided. see window.open reference

This is what it should like:

window.open(file, "Vaterland", "width=600, height=796, directories=no, 
    toolbar=no, location=no, status=no, menubar=no, resizable=no");

(line break added for readability. not to be included in final code)

... but this last remark is not what's causing your layout issues. If you're sure it's all because of the script, then it's because it's placed outside of <html>

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜