Click to See Complete Forum and Search --> : Javascript Error?


seaclearly
01-11-2004, 07:43 PM
One of my web pages has javascript which is supposed to
enlarge a map to view full-sized. However, something has been mistyped, and I cannot figure out what it is. Can anyone look at the following information from the html page and tell where the problem is?

<script language="JavaScript" type="text/JavaScript">
<!--function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } //-->

</script>
<a href="javascript:;" onclick="MM_openBrWindow('images/houmap.gif','map','width=500,height=420')">
<img src="images/houmap_sm.gif" alt="" hspace="15" vspace="15" border="0" align="left" width="250" height="250" /></a><a name="map" id="map">

I changed
<!--function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } //-->

to

<!--function MM_openBrWindow(theURL,winName,features) { window.open(theURL,winName,features); } //-->

Still does not work.

pyro
01-11-2004, 07:51 PM
You should really be using something like this (http://www.webdevfaqs.com/javascript.php#popup) to open new windows, for accessibility reasons.

Khalid Ali
01-11-2004, 10:12 PM
it would have been allot better if you had mentioned what error is that you are getting

fredmv
01-11-2004, 10:54 PM
No need to cross-post (http://forums.webdeveloper.com/showthread.php?s=&threadid=25106). I'd also have to agree with Ryan — that script doesn't provide very good accessibility as it won't allow people without JavaScript support to access the content.

Kor
01-12-2004, 02:41 AM
window.open('url','name','other attributes')

Now, I see that you have already a tag with the same name as you want to give to your window, which I think is not correct.

MM_openBrWindow('images/houmap.gif','map'

<a name="map" id="map">

what is that <a..> tag useful for?

pyro
01-12-2004, 10:39 AM
Originally posted by Kor
<a name="map" id="map">

what is that <a..> tag useful for? An anchor, so the specific place on the page can be linked to, ie: thepage.htm#map