Hi, anybody can tell me please how to Get xmlHttp.responseText when you call from IFrame?

I get empty xmlHttp.responseText, while when calling server from out the IFrame, I get the responseText without problem, how can I solve this problem? Thanks.


<input type="button" onclick="CallServer()">

5 Years
Discussion Span
Last Post by Moderns

To makes things clear:

Note: I am loading the IFrame content dynamically with the page (source) (IFrameSRC.php), IFrameSRC.php contains the html elements and the button which I click to call the AJAX. <IFrame src="IFrameSRC.php"></IFrame>

Inside page IFrameSRC.php:
<input type="button" onclick="CallServer()">

By the way when I call the server without the IFrame, it works perfect and I am able to get the response text from the AJAX file... Can any body helps me out with this? Thanks.

Thanks a lot!


if you have a button in an iframe which is on your parent page, then you have to write a function that calls that xmlHttp.responseText on that parent page. Try this, on the iframe page that is being loaded, put

function loadpage(url) {

parent page

function changepage(url){
document.getElementById("id").src = url;

This is to give you an example on how to call a javascript from your iframe to your parent page.


Thanks guys but I am not using the IFrame anymore, I am using the AJAX and normal DIV :)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.