Results 1 to 2 of 2

Thread: Using ajaxpack and PHP return php content only

  1. #1
    Join Date
    Nov 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Using ajaxpack and PHP return php content only

    Hi:

    I'm trying to use the ajaxpack.js provided by Dynamic Drive at ajaxroutine.htm.

    The code is exceedingly simple, taken right from the page:
    <script type="text/javascript" src="ajaxroutine.js"></script>
    </HEAD>
    <BODY>
    <div id="test"></div>
    <script type="text/javascript">
    function processGetPost()
    {
    var myajax=ajaxpack.ajaxobj;
    var myfiletype=ajaxpack.filetype;
    if (myajax.readyState == 4)
    {
    if (myajax.status==200 || window.location.href.indexOf("http")==-1)
    {
    if (myfiletype=="txt")
    {
    var target = document.getElementById("test");
    target.innerHTML=myajax.responseText;
    alert(myajax.responseText);
    }
    else alert("xml" + myajax.responseXML);
    }
    }
    }
    ajaxpack.getAjaxRequest("frames.php", "frameName=frame001", processGetPost, "txt");
    </script>

    Here is my frames.php:

    <?php
    $frame = $_GET['frameName'];
    echo $frame;
    ?>

    The responseText alert shows the complete text of frames.php, not frame001 as I hoped. I've fooled with it for a couple hours and am frustrated.
    I installed Xampp on a Windows XP laptop, which seems to be working fine.

    What little gotcha have I missed?

  2. #2
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    Warning: Please post all Dynamic Drive Script Related Questions here
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

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
  •