Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Multiple Ajax calls

Posted on 2013-01-28
6
Medium Priority
?
240 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

609 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