Results 1 to 2 of 2

Thread: Dynamic Drive Dynamic Ajax Contact IE Error

  1. #1
    Join Date
    Dec 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Dynamic Drive Dynamic Ajax Contact IE Error

    I have created a portfolio website and on my video galleries I have used the tutorial Dynamic Ajax Content - http://www.dynamicdrive.com/dynamici...jaxcontent.htm

    My site is - http://www.parkerherestudios.com/3danimation.html

    Each link in the left column should show a html page in the right column that contains a video and description. It works perfectly fine in FireFox, but contains errors in Explorer and will not display the html links in the left coloumn. Anyone know how to fix this? Any help would be greatly appreciated, I am very new to javascript and php.

    some code:

    Code:
    var loadedobjects=""
    var rootdomain="http://"+window.location.hostname
    
    function ajaxpage(url, containerid){
    var page_request = false
    if (window.XMLHttpRequest) // for Mozilla, Safari etc
    page_request = new XMLHttpRequest()
    else if (window.ActiveXObject){ // for IE
    try {
    page_request = new ActiveXObject("Msxml2.XMLHTTP")
    } 
    catch (e){
    try{
    page_request = new ActiveXObject("Microsoft.XMLHTTP")
    }
    catch (e){}
    }
    }
    else
    return false
    page_request.onreadystatechange=function(){
    loadpage(page_request, containerid)
    }
    page_request.open('GET', url, true)
    page_request.send(null)
    }
    
    function loadpage(page_request, containerid){
    if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
    document.getElementById(containerid).innerHTML=page_request.responseText
    }
    
    function loadobjs(){
    if (!document.getElementById)
    return
    for (i=0; i<arguments.length; i++){
    var file=arguments[i]
    var fileref=""
    if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
    if (file.indexOf(".js")!=-1){ //If object is a js file
    fileref=document.createElement('script')
    fileref.setAttribute("type","text/javascript");
    fileref.setAttribute("src", file);
    }
    else if (file.indexOf(".css")!=-1){ //If object is a css file
    fileref=document.createElement("link")
    fileref.setAttribute("rel", "stylesheet");
    fileref.setAttribute("type", "text/css");
    fileref.setAttribute("href", file);
    }
    }
    if (fileref!=""){
    document.getElementsByTagName("head").item(0).appendChild(fileref)
    loadedobjects+=file+" " //Remember this object as being already added to page
    }
    }
    }
    
    </script>
    
    
    
    	<div id="videocontainer">
        	    	<div id="leftcolumn">
    <a href="javascript:ajaxpage('videos/running.html', 'rightcolumn');">Running Man</a>
    <a href="javascript:ajaxpage('videos/walk.html', 'rightcolumn');">Walk</a>
    <a href="javascript:ajaxpage('videos/balls.html', 'rightcolumn');">Bouncing Balls</a>
    </div>
    Last edited by ddadmin; 12-06-2010 at 12:51 AM.

  2. #2
    Join Date
    Aug 2004
    Posts
    9,903
    Thanks
    3
    Thanked 967 Times in 955 Posts
    Blog Entries
    15

    Default

    There may be other errors on the page, but you should remove the following initialization code from the head section of your page:

    Code:
    ddsmoothmenu.init({
    	mainmenuid: "smoothmenu2", //Menu DIV id
    	orientation: 'v', //Horizontal or vertical menu: Set to "h" or "v"
    	classname: 'ddsmoothmenu-v', //class added to menu's outer DIV
    	//customtheme: ["#804000", "#482400"],
    	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
    })
    There is no "smoothmenu2" on your page.
    DD Admin

Bookmarks

Posting Permissions

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