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 3 of 3

Thread: Dynamic DIV

  1. #1
    Regular Coder
    Join Date
    May 2005
    Posts
    215
    Thanks
    14
    Thanked 0 Times in 0 Posts

    Dynamic DIV

    Hello all. I am currently viewing various reports based on a location chosen by a dropdown. When I select GO, the page sends the location to a popup, which then queries based on that location and displays the graph on the popup window. What I want to do is to eliminate the popup and send the location to a <div> on the same page and then have the query run and display the graph on the same page. Is this possible, or do Divs have to be static content?

    Thanks,

    Parallon

  • #2
    Regular Coder
    Join Date
    Jan 2006
    Posts
    568
    Thanks
    6
    Thanked 84 Times in 84 Posts
    It can be done with AJAX (or 'SJAX' in this case):

    Code:
    var request=window.XMLHttpReqest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP");
    request.open("GET", "yourpage.html", false);
    request.send(null);
    
    document.getElementById("yourdiv").innerHTML=request.responseText;
    but why not just use an iframe?

  • #3
    Regular Coder
    Join Date
    May 2005
    Posts
    215
    Thanks
    14
    Thanked 0 Times in 0 Posts
    Thanks alot. I totally forgot about iframes. As usual, I always try to over complicate things...

    Parallon


  •  

    Posting Permissions

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