Solved

Multiple Ajax calls

Posted on 2013-01-28
6
224 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 108

Expert Comment

by:Ray Paseur
Comment Utility
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
Comment Utility
take a look to the pages attached
getvarinpage.html
login.php
0
 
LVL 33

Expert Comment

by:Slick812
Comment Utility
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:j789
Comment Utility
Hi Ray_Paseur, can you please provide an example or link? Thanks
0
 
LVL 108

Accepted Solution

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

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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 look for a specific file type in a local or remote server directory using PHP.

728 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now