FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » PHP/AJAX Problem
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: PHP/AJAX Problem [message #170829 is a reply to message #170827] Wed, 01 December 2010 00:26 Go to previous messageGo to previous message
bruceaj is currently offline  bruceaj
Messages: 30
Registered: September 2010
Karma:
Member
On Nov 30, 7:11 pm, Magno <marbar...@gmail.com> wrote:
> On 11/30/2010 08:15 PM, bruceaj wrote:
>
>> My AJAX response from my PHP flashes briefly then goes away.
>
>> Appreciate it if someone can give me some suggestions on what I need
>> to do to correct this problem.
>
> Hard to guess anything without any code provided.
> Please provide the minimum code needed to reproduce the issue.

Here is my Code. This is the call from my main routine

<input name="btnSearch" type="submit" id="btnSearch"
onclick="getData('results')", value="Submit Search" />

This is the function that makes a "Synchronous" call to APAX.. I'm
using Synchronous to try to debug my problem.

target points to the output area in my main routine, <div
id-'results'></div>
function getData(target) {
var serverPage = "getCensusData.php";
var parmStr = "lastname=Jul%";
var obj = document.getElementById(target);
processSJAXPost(serverPage, parmStr, obj);
}

Here is my SJAX call.
function processSJAXPost(serverpage, parmStr, obj) {

xmlhttp = getxmlhttp();
xmlhttp.open("POST", serverpage, false);
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-
urlencoded");
xmlhttp.setRequestHeader("Content-length", parmStr.length);
xmlhttp.setRequestHeader("Connection", "close");
xmlhttp.send(parmStr);

obj.innerHTML =
xmlhttp.responseText;;
}

My PHP routine is nothing but an single statement, <?php echo
"getData()"; ?>
Now, I'm getting a result from my PHP routine but it "flashs" and goes
away.

Thanks for the help..

Bruce
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: return value?
Next Topic: Stats comp.lang.php (last 7 days)
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 14:48:10 GMT 2024

Total time taken to generate the page: 0.04288 seconds