where i need to write this line , please tell me sir
Main Topics
Browse All Topicshttp.open('get', ,true); // here is the problem
i have 2 files named 2.php and 2.js . i am using ajax here. now in 2.php u can see that i have a code in which when the user selects the option from the dropdown then it will go to the respective page,
1) now i want that if the user selects the option like products and click on go then produxts.php page should open with the help of ajax, so what should i write in http.open('get','?????',tr
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
The line I gave you wasn't for the PHP it was the JS... Perhaps I don't understand what you want. You mean that when you submit that form after selecting Products, it fills in div "abc" with the contents of products.php?
What I gave you gets which item is selected so it knows what page to ask AJAX to get. Is there another problem?
Works for me when I do this:
<form method="post" onsubmit="redirect_page();
Instead of this:
<form method="post" onsubmit="return redirect_page()">
You are trying to return the value of redirect_page, when all you really want to do is run the function. Also return false; stops the page from refreshing after you submit. When it refreshes it just wipes out any content that could have been written anyway.
>>The line I gave you wasn't for the PHP it was the JS
that i understand and sir i have tried ur code as u have given above.
>>You mean that when you submit that form after selecting Products, it fills in div "abc" with the contents of products.php?
this is the main problem sir contents of products.php page are not being filled to the div abc. this is what i want to resolve.
>>What I gave you gets which item is selected so it knows what page to ask AJAX to get. Is there another problem?
sir ajax is not calling the respective page , in my above post i have given the snapshot showing that there is no response coming from the products.php page. because the ajax is not calling the respective page. this is the problem
respected sir , the code which i am using has been posted by me in above posts,please have a look at that. by my opinion it should be right but don't know why the problem is coming??
thanks
>>Works for me when I do this:
it is working yes , i am not using return false if u see my above code. this is done sir , please focus on the issue of inability of javascript page to call the php page that is products.php. 2.php page returns the page, that is right, i alerted
alert(page)/ it shows me the right page name
alert(response) // here is the problem sir.
You have to use return false; to prevent it from trying to leave the page. When it is trying to leave the page it won't give you the contents. Why can't you use return false; on it?
Another choice would be to replace the submit button with this:
<input type="button" onclick="redirect_page()" name="submit" value="Go">
Yes, just create another function to handle the products and make the links run the function. (this code is untested but should work)
For example, make products.php have this source:
<a href="javascript:show_prod
<a href="javascript:show_prod
Then add this to the JS file:
function show_product(file){
//alert("hi")
http.open('get',file, true); // here we are calling the respective page
http.onreadystatechange = function(){
if(http.readyState == 4){
var response = http.responseText;
alert(response)// here no response is coming.
document.getElementById('p
}
}
http.send(null);
}
Business Accounts
Answer for Membership
by: OpalelementPosted on 2009-07-03 at 22:16:30ID: 24775826
document.getElementById('m enu').opti ons[docume nt.getElem entById('m enu').sele ctedIndex] .value