Results 1 to 7 of 7

Thread: open a html page inside div when click on links

  1. #1
    Join Date
    May 2008
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default open a html page inside div when click on links

    with out refreshing the page i would like to load the another html page inside by page using DIV.. how i can do that..

    1.already i have mainmenu left, when click the link in menu another html should be load in rightside of my page which contains a container DIV.

    how i can do that, i tried XMLHttpRequest.. but its working fine in local machine, when i put in server its not working for IE6. in local machine its working for all browser..

    please let me any other method..

    its urgent for me..

    thanks in advance...

  2. #2
    Join Date
    Feb 2008
    Posts
    81
    Thanks
    8
    Thanked 5 Times in 5 Posts

    Default

    hi,

    well you can use the dynamic ajax content at dynamic drive it is in your site format!

  3. #3
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,734
    Thanks
    46
    Thanked 216 Times in 209 Posts
    Blog Entries
    53

    Default

    You could try this, or this, or this.
    (Midhul, ravimmrk doesn't want 'dynamic ajax content', because he doesn't want ajax).
    ---
    Arie Molendijk.

  4. #4
    Join Date
    May 2008
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default not working in ie7

    Quote Originally Posted by midhul View Post
    hi,

    well you can use the dynamic ajax content at dynamic drive it is in your site format!
    ------------
    thanks for help.. but the prob with that was its working fine.. in ie6 but not working in ie7.. in local and server...

    any solution for that...

  5. #5
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Well, the script works in IE7. So, it has nothing to do with it when it's properly implemented. You should create a new thread in the proper forum, post your code and/or a link to your site and someone will be better able to help you.

  6. #6
    Join Date
    May 2008
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Below given is the code....

    var bustcachevar=1 //bust potential caching of external pages after initial request? (1=yes, 0=no)
    var loadedobjects=""
    var rootdomain="http://"+window.location.hostname
    var bustcacheparameter=""

    function ajaxpage(url, containerid){
    var page_request = false
    if (window.XMLHttpRequest) // if Mozilla, Safari etc
    page_request = new XMLHttpRequest()
    else if (window.ActiveXObject){ // if 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)
    }
    if (bustcachevar) //if bust caching of external page
    bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
    page_request.open('GET', url+bustcacheparameter, 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
    }
    }
    }

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,370
    Thanks
    77
    Thanked 3,421 Times in 3,382 Posts
    Blog Entries
    12

    Default

    That is this DD script:

    http://www.dynamicdrive.com/dynamici...jaxcontent.htm

    If you are using it without the credit (as it appears in your post):

    Your page is in violation of Dynamic Drive's usage terms, which, among other things, state that the script credit must appear in the source code of the page(s) using the script. Please reinstate the notice first.


    For future reference:

    Warning: Please include a link to the DD script in question in your post. See this thread for the proper posting format when asking a question.


    Start a new thread in the DD scripts help section:

    http://www.dynamicdrive.com/forums/forumdisplay.php?f=2

    closing this thread.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •