Solved

Multiple Ajax calls

Posted on 2013-01-28
6
228 Views
Last Modified: 2013-02-01
Hi all,

I have a php page that calls another page using this code...

xmlhttp.open("GET","login.php",false);
xmlhttp.send();
document.getElementById("myDiv").innerHTML=xmlhttp.responseText;

Open in new window


...what I'd like to do is call another page using variable value info returned from this page.

Thanks.
0
Comment
Question by:j789
6 Comments
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 38830639
You can do that.  What is the question?

You would probably be better off using jQuery instead of trying to write the AJAX calls yourself.  Cross-browser, standard framework, etc.  jQuery has many advantages.
0
 
LVL 82

Expert Comment

by:leakim971
ID: 38830935
take a look to the pages attached
getvarinpage.html
login.php
0
 
LVL 34

Expert Comment

by:Slick812
ID: 38831474
greetings   j789;  You get this back from the login.php ajax retrieve - xmlhttp.responseText , To take out the Text section of this string that has the "variable value" you want (a URL I guess) , , you will need to go through the  xmlhttp.response  Text and detect and separate the URL out of it. But you do not say what might be in this  xmlhttp.response for us to help you do that.
There are some better ways to get variables from returned ajax strings, using some other ways to set-up your ajax PHP script return to browser ajax.
please Ask questions if you need more information about this.
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Author Comment

by:j789
ID: 38841541
Hi Ray_Paseur, can you please provide an example or link? Thanks
0
 
LVL 109

Accepted Solution

by:
Ray Paseur earned 250 total points
ID: 38844288
I have a "hello world" example of jQuery/AJAX in this article.  Maybe you could extend that concept to make another GET or POST request.
http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Jquery/A_10712-The-Hello-World-Exercise-with-jQuery-and-PHP.html
0
 
LVL 82

Assisted Solution

by:leakim971
leakim971 earned 250 total points
ID: 38844302
ID: 38830935 have complete working codes...
0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question