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 #170835 is a reply to message #170829] Wed, 01 December 2010 10:15 Go to previous messageGo to previous message
Jeff North is currently offline  Jeff North
Messages: 58
Registered: November 2010
Karma:
Member
On Tue, 30 Nov 2010 16:26:43 -0800 (PST), in comp.lang.php bruceaj
<bruceaj(at)bellsouth(dot)net>
<7a800d5d-7bb8-4797-a7b6-92ce644f0d33(at)i25g2000prd(dot)googlegroups(dot)com>
wrote:

> | 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" />

Is this button within a <form> element?

> | 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);

If so then do a return false; here.

> | }
> |
> | 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 12:59:32 GMT 2024

Total time taken to generate the page: 0.04573 seconds