PDA

View Full Version : Page Won't Open



earlp
03-29-2009, 04:18 AM
1) Script Title: Anylink

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm

3) Describe problem: I downloaded the 3 files and the script, had it working for a while. I started adding and changing links, and now (Using Frontpage) when opening/previewing, the page will actually open, but with a popup box that says that Internet Explorer can not open the page that it in fact just opened. I click the OK box then get a page that says the requested page can not be displayed...

I have downloaded all 3 files again. Without modifying MenuContents.js file at all, my page will open, but of course my menu items are not working. I change the MenuContents.js file for my menu names, and that's when the page opens with the popup box.

my page is www.gmarc.com/defaulttest.asp

jscheuer1
03-29-2009, 10:59 AM
IE often requires valid code when loading pages that have scripts on them. It may even go so far as requiring closing tags to elements that don't always require them.

Now, your menucontents.js has only one menu in it, so there will still be errors, but the one menu you have will work. Try this valid code:


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>GMA Home Page</title>
<link rel="stylesheet" type="text/css" href="anylinkmenu.css">

<script type="text/javascript" src="menucontents.js"></script>

<script type="text/javascript" src="anylinkmenu.js">

/***********************************************
* AnyLink JS Drop Down Menu v2.0- Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Project Page at http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm for full source code
***********************************************/

</script>
</head>
<body bgcolor="#C2CDC6" link="#808000" vlink="#808000">
<div align="center">
<table border="0" width="981">
<tr>
<td width="251" bgcolor="#C2CDC6">
<p align="center"><img alt="" border="0" src="images/Logo/GMALogo-20-3-250.gif" width="190" height="200"></td>
<td width="411" bgcolor="#C2CDC6">
<p align="center"><img alt="" border="0" src="images/AerialView2-Wayne.jpg" width="353" height="227">&nbsp;&nbsp;
</p>
</td>
<td width="297" bgcolor="#C2CDC6" valign="top">
<img alt="" border="0" src="images/HomePage/white-carson.jpg" width="297" height="224">
</td>
</tr>
</table>
</div>
<p align="center"><b><font size="2" face="Arial">
<a href="http://www.gmarc.com" class="menuanchorclass" rel="menu99">About Us</a>&nbsp;&nbsp;&nbsp;

<a href="http://www.gmarc.com" class="menuanchorclass" rel="menu2" rev="lr">Members</a>&nbsp;&nbsp;&nbsp;
<a href="http://www.gmarc.com" class="menuanchorclass" rel="menu3" rev="lr">Events</a>&nbsp;&nbsp;&nbsp;
<a href="http://www.gmarc.com" class="menuanchorclass" rel="menu4" rev="lr">Safety &amp; Rules</a>&nbsp;&nbsp;&nbsp;
<a href="http://www.gmarc.com" class="menuanchorclass" rel="menu5" rev="lr">Location</a>&nbsp;&nbsp;&nbsp;
<a href="http://www.gmarc.com" class="menuanchorclass" rel="menu6" rev="lr">News</a>&nbsp;&nbsp;&nbsp;
<a href="http://www.gmarc.com" class="menuanchorclass" rel="menu7" rev="lr">Forums</a>&nbsp;&nbsp;&nbsp;
<a href="http://www.gmarc.com" class="menuanchorclass" rel="menu8" rev="lr">Gallery</a>&nbsp;&nbsp;&nbsp;
<a href="http://www.gmarc.com" class="menuanchorclass" rel="menu9" rev="lr">Contacts</a>&nbsp;&nbsp;&nbsp;
<a href="http://www.gmarc.com" class="menuanchorclass" rel="menu10" rev="lr">Links</a></font></b>
</p>
<script type="text/javascript">

//anylinkmenu.init("menu_anchors_class")! //call this function at the very *end* of the document!
anylinkmenu.init("menuanchorclass")
</script>
</body>
</html>

Though I fixed many errors of validation in the HTML code, the most important change is the addition of the closing </p> tag (highlighted) near the end. Using p in a page is always risky where scripts are involved. It's generally a self closing tag, but if a script comes after it, browsers may become confused.

earlp
03-29-2009, 04:17 PM
Adding that ending /p seems to have fixed it. I'll go add the other links back in.
Thanks