[mapguide-users] Microsoft JScript runtime error

Thomas M. Tuerke thomas.m.tuerke at autodesk.com
Tue Sep 5 17:06:22 EDT 2006


There may be a timing issue involved.  Seems like there are two windows at play here, and the grandparent in question may not be ready (it may still be loading) even though your page is already done (your onPageLoad has fired.)

 

JavaScript is pretty compartmentalized, so there may be security constraints that prevent you from realizing whether another window has loaded (that’s been true for IE, anyway.)

 

One workaround might be to fire off a setTimeout on page load, where the timeout would call the Zoom, which predicated on the assumption that all pages finish loading by the time the timeout expires.  Another option is to have the grandparent do the actual ZoomToView upon its reaching loaded state.

 

- Thomas

 

  _____  

From: Adam Herbert [mailto:adam at aemsaustralia.com.au] 
Sent: Tuesday, September 05, 2006 1:57 PM
To: users at mapguide.osgeo.org
Subject: [mapguide-users] Microsoft JScript runtime error

 

Hi,

 

I am running this code:

 

<script type="text/javascript">

            function onPageLoad()

            {

                parent.parent.ZoomToView(<%=x %>, <%=y %>, 110000, true);

            }

            </script>

</head>

<body class="AppFrame" onload="onPageLoad()">

 

And getting this error:

 

Microsoft JScript runtime error: Object doesn't support this property or method

 

mapFrame.ZoomToView(x,y,scale,refresh); on Line 213 of ajaxviewer.aspx

 

I can run this fine from a link on the same page and point it to the scriptFrame but when I try to run the onPageLoad function it fails.

 

Any ideas on what I might be doing wrong?

Adam Herbert
IT Manager
AEM Solutions Pty Ltd
PO Box 514, Toowoomba Q. 4350
Phone: 07 4613 0455
Cell: 0437 599 907
Website: www.aemsaustralia.com.au <http://www.aemsaustralia.com.au> 

Important Disclaimer and Warning

AEMS does not represent or warrant that any attached files are free from computer viruses or other defects. The attached files are provided, and may only be used, on the basis that the user assumes all responsibility for any loss, damage or consequences resulting directly or indirectly from use of the attached files. The liability of AEMS in any event is limited to either the re-supply of the attached files or the cost of having the attached files re-supplied.

NOTE: The views expressed by the individual in this message do not necessarily reflect those of the organisation.

AEMS is committed to protecting the privacy of individuals, and is bound by the principles of the Commonwealth Privacy Act (1988).

The information contained in this message is confidential and may be legally privileged. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, dissemination, or reproduction is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20060905/a54f3170/attachment.html


More information about the Mapguide-users mailing list