Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Javascript file not running in IE7

    Hello all. I am new around here and to coding in general, so please keep in mind that I'm a complete noob. With that being said, I am working on a site and decided to use vertical javascript menus. I found this script http://www.javascriptkit.com/script/...icalmenu.shtml and found it to be to my liking. So, I implemented it into my code and then the problems started. Everything works perfect in FF and Safari, but Internet Explorer will not run the .js file for some reason. At least that's where I think the problem is.

    Originally I had the js script tag in the heading as the page describes, but IE would not load anything on the page. I moved the script tag to the bottom just above the /body tag and now it will load the entire page, but the the script itself. FF and Safari have worked irregardless.

    Does anyone have any suggestions? I am not opposed to using FF or Safari, I would just rather use IE. I would appreciate any help and will answer any questions or provide anything anyone needs to help me.

    Thanks!

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,862
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Can you post a link to your page before modification?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Oh, I forgot to mention, when I try to load the page in IE7, the ActiveX bar appears at the top gives it generic message about blocking scripts. I tell it to run blocked scripts and nothing happens. Just thought I would mentioned that.

    Also, I have tried it on two different machines with IE7 and one machine with IE6 and they all do the same thing. so, I assume it is solely an IE problem.

  • #4
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Well, that's a problem. Currently, I only run the page locally. I currently do not have a host or anything. I was waiting till I at least had some content for people to see. Any ideas?

  • #5
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,862
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Then post the code of your current page. (use wrap [code] option)
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #6
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Okay, here is what exists of my mainpage (yes, it's mostly empty). I hope I'm posting this right.

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    	<meta http-equiv="Content-Type" content="text/html; charset=ansi" />
    	<title>Final Fantasy</title>
    	<link rel="stylesheet" type="text/css" href="styles/main.css" />
    	<link rel="stylesheet" type="text/css" href="styles/verticalmenu.css" />
    </head>
    
    <body>
    	<table id="main">
    		<tr>
    			<td class="Themes" colspan="2">
    				<table id="mt1">
    					<tr>
    						<td>
    							Final Fantasy
    						</td>
    					</tr>
    				</table>
    			</td>
    		</tr>
    		<tr>
    			<td class="Themes">
    				<ul id="verticalmenu" class="glossymenu">
    					<li class="games">&nbsp;</li>
    					<li class="systems">Nintendo</li>
    					<li class="games"><a href="ffi/ffimain.html">Final Fantasy I</a>
        						<ul>
        							<li><a href="ffi/maps.html">Maps</a></li>
        							<li><a href="ffi/monsters.html">Monsters</a></li>
        							<li><a href="ffi/walkthrough000.html">Walkthrough</a></li>
        						</ul>
    					</li>
    					<li class="games"><a href="ffii/ffiimain.html">Final Fantasy II</a></li>
    					<li class="games"><a href="ffiii/ffiiimain.html">Final Fantasy III</a></li>
    					<li class="systems">Super Nintendo</li>
    					<li class="games"><a href="ffiv/ffivmain.html">Final Fantasy IV</a></li>
    					<li class="games"><a href="ffv/ffvmain.html">Final Fantasy V</a></li>
    					<li class="games"><a href="ffvi/ffvimain.html">Final Fantasy VI</a></li>
    					<li class="games"><a href="ffmq/ffmqmain.html">Final Fantasy MQ</a></li>
    					<li class="systems">Playstation</li>
    					<li class="games"><a href="ffvii/ffviimain.html">Final Fantasy VII</a></li>
    					<li class="games"><a href="ffviii/ffviiimain.html">Final Fantasy VIII</a></li>
    					<li class="games"><a href="ffix/ffixmain.html">Final Fantasy IX</a></li>
    					<li class="games"><a href="fft/fftmain.html">Final Fantasy T</a></li>
    					<li class="games">&nbsp;</li>
    				</ul>
    			</td>
    			<td>
    				<table id="rn1">
    					<tr>
    						<td>
    							<p>&nbsp;</p>
    						</td>
    					</tr>
    				</table>
    			</td>
    		</tr>
    		<tr>
    			<td class="Themes" colspan="2">
    				<table id="ft1">
    					<tr>
    						<td>
    							Questions, comments, or suggestions?  I welcome all!  Please feel free to contact me <a id="email" href="mailto:finalfantasysanctum@gmail.com">here.</a>
    						</td>
    					</tr>
    				</table>
    			</td>
    		</tr>
    	</table>
    	<script type="text/javascript" src="scripts/verticalmenu.js">
                
    /***********************************************
    
    * CSS Vertical List Menu- by JavaScript Kit (www.javascriptkit.com)
    * Menu interface credits: http://www.dynamicdrive.com/style/csslibrary/item/glossy-vertical-menu/ 
    * This notice must stay intact for usage
    * Visit JavaScript Kit at http://www.javascriptkit.com/ for this script and 100s more
    
    ***********************************************/
    
    </script>
    </body>
    
    </html>
    Last edited by jasonawatkins; 08-30-2007 at 04:05 PM.

  • #7
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts
    And here is the Javascript file referenced.

    Code:
    var menuids=new Array("verticalmenu") //Enter id(s) of UL menus, separated by commas
    var submenuoffset=-2 //Offset of submenus from main menu. Default is -2 pixels.
    
    function createcssmenu(){
    for (var i=0; i<menuids.length; i++){
      var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
        for (var t=0; t<ultags.length; t++){
        var spanref=document.createElement("span")
    		spanref.className="arrowdiv"
    		spanref.innerHTML="&nbsp;&nbsp;"
    		ultags[t].parentNode.getElementsByTagName("a")[0].appendChild(spanref)
        ultags[t].parentNode.onmouseover=function(){
        this.getElementsByTagName("ul")[0].style.left=this.parentNode.offsetWidth+submenuoffset+"px"
        this.getElementsByTagName("ul")[0].style.display="block"
        }
        ultags[t].parentNode.onmouseout=function(){
        this.getElementsByTagName("ul")[0].style.display="none"
        }
        }
      }
    }
    
    
    if (window.addEventListener)
    window.addEventListener("load", createcssmenu, false)
    else if (window.attachEvent)
    window.attachEvent("onload", createcssmenu)

  • #8
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,862
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Its working for me in IE6.Paste the <script> inside <head>. as per their direction, and be sure that the path of the JS file,CSS and images are all correct according to your html code.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    jasonawatkins (08-30-2007)

  • #9
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Ah, I figured it out. What I pasted up here was the original code and not the current I was working on. I only had a few minor changes, but one of the was that I had contracted the script tag to <script xxxx /> instead of using opening and closing script tags. I changed it back and now it works in IE. Who knows?

    Thanks for your help!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •