Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Javascript error
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Javascript error

 Post Reply Post Reply
Author
simflex View Drop Down
Groupie
Groupie
Avatar

Joined: 10 November 2002
Location: United States
Status: Offline
Points: 63
Post Options Post Options   Thanks (0) Thanks(0)   Quote simflex Quote  Post ReplyReply Direct Link To This Post Topic: Javascript error
    Posted: 13 November 2003 at 7:05pm

I didn't see javascript forum, so I just ask my question here, if you don't mind.

I have been trying to figure out why I am having the following error:

top.body_frame.left_frame' is null or not an object

Please take a look at my code and tell me what I am doing wrong.

Thanks in advance

<script language="javascript" src="../mapserv.js"></script>
<script language="javascript1.2" src="../dynlayer.js"></script>
<script language="javascript1.2" src="../mouseevents.js"></script>
<script language="javascript1.2">

function init() {
 dragObject = new DynLayer("square");
 dragObject.dragActive = false;
 topObject = new DynLayer("top");
 leftObject = new DynLayer("left");
 bottomObject = new DynLayer("bottom");
 rightObject = new DynLayer("right");

 initMouseEvents();

 if (is.ie){
 document.all.square.style.top = "0px";
 }

 if (is.ns5){
 d = document.getElementById("square");
 d.style.top = 0;
 d.style.left = 0;
 }
}

</script>

<style type="text/css">
<!--
#square {position:absolute; left:0px; top:0px; width:80px; height:55px; clip:rect(0px 800px 550px 0px); visibility:hidden; background-color:blue; layer-background-color:blue;}
#top {position:absolute; left:0px; top:0px; width:150px; height:1px; font-size:1px; visibility:hidden; background-color:black; layer-background-color:black; z-index:200;}
#left {position:absolute; left:0px; top:0px; width:1px; height:150px; font-size:1px; visibility:hidden; background-color:black; layer-background-color:black; z-index:200;}
#bottom {position:absolute; left:0px; top:0px; width:150px; height:1px; font-size:1px; visibility:hidden; background-color:black; layer-background-color:black; z-index:200;}
#right {position:absolute; left:0px; top:0px; width:1px; height:150px; font-size:1px; visibility:hidden; background-color:black; layer-background-color:black; z-index:200;}
#map {position:absolute; left:0px; top:0px; visibility:visible; z-index:100;}

-->
</style>
</head>
<body OnLoad="init();setModetoLast();setReference();">
<div id="square"></div>
<div id="top"></div>
<div id="left"></div>
<div id="bottom"></div>
<div id="right"></div>
<form method="get" name="mapserv" action="/ms4.0/mapserv" target="_self" onSubmit='return setParams()'>
<!--# of layer input elements = # of layers + 1 -->
<input type="hidden" name="layer" value="">
<input type="hidden" name="layer" value="">
<input type="hidden" name="layer" value="">
<input type="hidden" name="layer" value="">
<input type="hidden" name="layer" value="">
<input type="hidden" name="layer" value="">
<input type="hidden" name="layer" value="">
<input type="hidden" name="layer" value="">
<input type="hidden" name="layer" value="">
<input type="hidden" name="layer" value="">
<input type="hidden" name="layer" value="">
<input type="hidden" name="layer" value="">
<input type="hidden" name="layer" value="">
<input type="hidden" name="layer" value="">
<input type="hidden" name="layer" value="">
<input type="hidden" name="layer" value="">
<input type="hidden" name="layer" value="">
<input type="hidden" name="layer" value="">
<input type="hidden" name="layer" value="">
<input type="hidden" name="layer" value="">
<input type="hidden" name="layer" value="counties">
<input type="hidden" name="qlayer" value="">
<input type="hidden" name="map_sparcel_class_expression" value="'#'">
<input type="hidden" name="mapsize" value="[mapsize]">
<input type="hidden" name="imgext" value="[mapext]">
<input type="hidden" name="mapext" value="">
<input type="hidden" name="imgxy" value="">
<input type="hidden" name="imgbox" value="">
<input type="hidden" name="reference" value=[ref]>
<input type="hidden" name="map" value=[map]>
<input type="hidden" name="zoomdir" value="[zoomdir]">
<input type="hidden" name="zoomsize" value="2">
<input type="hidden" name="mode" value="[mode]">
<input type="hidden" name="lastzoomdir" value="">
<input type="hidden" name="legend" value="[legend]">
<input type="hidden" name="template" value="map.html">
</form>
<div id="map"><img name="img" src="[img]" border="0"></div>

<script>
if ( navigator.appName == "Netscape") {
 var mapwidth = (window.innerWidth).toString();
 var mapheight = (window.innerHeight).toString();
}
else {
 var mapwidth = (top.body_frame.left_frame.document.body.clientWidth).toStri ng();
 var mapheight = (top.body_frame.left_frame.document.body.clientHeight).toStr ing();

}
document.mapserv.mapsize.value = mapwidth + " " + mapheight;
</script>
</body>
</html>

Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 13 November 2003 at 7:31pm
looks like this script was written thinking it'd be in frames, and that one of the frames would be named "left_frame" and its not there.. hence its "null or not an object"
Contribute to the working anarchy we fondly call the Internet
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.