By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,481 Members | 1,211 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,481 IT Pros & Developers. It's quick & easy.

JavaScript Error Page in IE

P: 2
I am having problem with IE. This is the code that I am using, and it works good in every browser except in IE. If somebody can help PLEASE:


<script language="Javascript" type="text/javascript"> <!--
function showTerms() {
var newWin = window.open('http://slee.com/thisgoesnowhere','','width=500,height=450,menubar= no,location=no,status=no,scrollbars=yes,toolbar=no ,resizable=yes');
}

// this doesn't work
//window.onload = setLeftColHeight();

function setLeftColHeight() {
var obj = document.getElementById('middleheight');

if (obj) {
var h = obj.height;
}
}
// -->
</script>
<FORM METHOD="post" ACTION="/cgi-bin/mivavm?/Merchant2/merchant.mvc+">
<table border="0" cellpadding="0" cellspacing="0">

<div id="header"> <img
src="http://slee.com/joomla/templates/jw_inetgazette2/images/righttaglineblue.gif" style="float: right;" border="0"> </div>
<div id="logo"> <img
src="http://slee.com/joomla/templates/jw_inetgazette2/images/ig_shield_blue.png">
</div>
<div id="horizontal">
<map name="sleemap">
<area shape="rect" coords="151,1,227,28"
href="http://www.slee.com/joomla/index.php?option=com_content&amp;task=view&amp;id= 16&amp;Itemid=31">
<area shape="rect" coords="228,1,332,28"
href="http://www.slee.com/joomla/index.php?option=com_content&amp;task=view&amp;id= 12&amp;Itemid=86">
<area shape="rect" coords="333,1,441,28"
href="http://www.slee.com/joomla/index.php?option=com_content&amp;task=view&amp;id= 75&amp;Itemid=89">
<area shape="rect" coords="442,1,581,28" href="http://slee.com/cgi-bin/mivavm?/Merchant2/merchant.mvc">
<area shape="rect" coords="584,1,659,28"
href="http://www.slee.com/joomla/index.php?option=com_weblinks&amp;Itemid=23">
<area shape="rect" coords="660,1,736,28"
href="http://www.slee.com/joomla/index.php?option=com_content&amp;task=section&amp; id=3&amp;Itemid=88">
<area shape="rect" coords="737,1,840,28"
href="http://www.slee.com/joomla/index.php?option=com_contact&amp;catid=12&amp;Item id=73">
</map>
<img src="http://slee.com/joomla/templates/jw_inetgazette2/images/slee_image_map.png"
alt="Image Map" border="0" usemap="sleemap" height="33px" width="930" />
</div><div style="clear: both;"></div>
</body>
</html>


It shows error in "document.getElementById". I am not that good with Java, so if somebody can help.
Jun 19 '07 #1
Share this Question
Share on Google+
3 Replies


epots9
Expert 100+
P: 1,351
instead of: window.onload = setLeftColHeight();

use the onload in the body tag:
[HTML]
<body onload="setLeftColHeight();">
[/HTML]

because your script is in the head and your elements haven't been loaded yet so when u use getElementById, it fails since those elements don't exist yet.

good luck
Jun 19 '07 #2

P: 2
instead of: window.onload = setLeftColHeight();

use the onload in the body tag:
[HTML]
<body onload="setLeftColHeight();">
[/HTML]

because your script is in the head and your elements haven't been loaded yet so when u use getElementById, it fails since those elements don't exist yet.

good luck
It is not working. i am having this problem only with IE. I am working with layover images, nut the images that are in the background are not showing in IE. It works fine in every other browser. This is the link and if you open it in Firefox and IE you will see the problem:

http://virtusgroup.com/cgi-bin/mivav...2/merchant.mvc



Thank you for your help.
Jun 19 '07 #3

acoder
Expert Mod 15k+
P: 16,027
I don't see any errors in IE. Have you solved this problem?
Jun 20 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.