?
Solved

Multiple Ajax calls

Posted on 2013-01-28
6
Medium Priority
?
236 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 111

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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

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

Accepted Solution

by:
Ray Paseur earned 750 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 750 total points
ID: 38844302
ID: 38830935 have complete working codes...
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

752 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