Results 1 to 8 of 8

Thread: problems with Dynamic Ajax Content

  1. #1
    Join Date
    Dec 2008
    Posts
    48
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default problems with Dynamic Ajax Content

    1) Dynamic Ajax Content

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

    3) Hello, i am trying to use this script but with POST instead of GET. was searching for forums and found some help but the script was a little different and i still cant get it to work. As my JS skill are very limited i would be glad if anyone could help me get this to work.

    here is what i changed based on the previous post i found.

    Code:
    page_request.open('GET', url+bustcacheparameter, true)
    page_request.send(null)
    with

    Code:
    page_request.open('POST', url+bustcacheparameter, true);
    page_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    var pineapple = document.getElementById("form1").elements; // formID needs to be the ID of your form
    for(var fl = 0;fl < pineapple.length; fl++) page_request.send(pineapple[i].name + "=" + pineapple[i].value);
    mozilla console error gives:
    i is not defined

    the form id is form1 btw...

    cheers

  2. #2
    Join Date
    Dec 2008
    Posts
    48
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default

    lol! stupid bot...

  3. #3
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    Code:
    for(var fl = 0;fl < pineapple.length; fl++) page_request.send(pineapple[i].name + "=" + pineapple[i].value);
    It seems that the loop variable used in fl not i

  4. #4
    Join Date
    Dec 2008
    Posts
    48
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default

    yeah i had fixed that, should have updated this, thanks.

    For some reason this script only passes one variable, the first to appear, either in get or post... anyone know why ?

  5. #5
    Join Date
    Dec 2008
    Posts
    48
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default

    somewhere along this line, i would think... the url loses the variables

    Code:
    bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
    its the only place i see that builds the url... but like i said i dont know much about js

  6. #6
    Join Date
    Dec 2008
    Posts
    48
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default

    trying with the original code, and with GET, i still cant submit a form using GET and get the variables...

    for example:

    Code:
    <a href="javascript:ajaxpage(rootdomain+'/page.php?age=16&name=oli', 'mydiv');">send info</a>
    works fine and send the variables BUT with

    Code:
    <form name="form1" id="form1" method="get" action="javascript:ajaxpage(rootdomain+'/page.php', 'mydiv');">
    <input type="hidden" name="age" id="age" value="16">
    <input name="name" type="text" id="name" value="oli" size="10" maxlength="10">
    <input name="button" type="submit" id="button" value="send info">
    </form>
    the DD code will not get the variables.
    Please help me, i have alot of stuff done and everything is only waiting on this

  7. #7
    Join Date
    Dec 2008
    Posts
    48
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default

    searching the forums a little more i found more people with the same issue and unresolved. I think this is a big limitation on this script and would be nice to fix it and update it on the website.

    Links to the other posts:
    http://www.dynamicdrive.com/forums/s...ad.php?t=38195
    http://www.dynamicdrive.com/forums/s...ad.php?t=21704
    http://www.dynamicdrive.com/forums/s...d.php?p=173047

  8. #8
    Join Date
    Dec 2008
    Posts
    48
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default

    i have put everything together outside my project just so that you guys can check it out, live.

    http://www.bulletdrive.com/ajaxtest/


    the external.php code:

    Code:
    <?
    
    $refresh 		= $_GET["refresh"];
    $text 		= $_GET["text"];
    
    print_r($_GET);
    
    ?>

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
  •