Link to home
Start Free TrialLog in
Avatar of Salah a a a Al Jasem
Salah a a a Al JasemFlag for Kuwait

asked on

Using xmlhttp.open in page1 calls page2 and the result is needed to be in page1

To avoid post back I use xmlhttp.open

so far I manage to display text on the bottom of page1 using the called page2

function showMada(str)
{
    xmlhttp.open("GET", "getmada.aspx?q=" + str, true);
    xmlhttp.send();
}
how to change the contents of a specific textbox and a P tag in page1

Thanks
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Maybe wait for the answer in the active SO question?
We still do not quite understand what you mean there either
Avatar of Salah a a a Al Jasem

ASKER

Do you suggest that I close my account here? and ask only in SO?
Of course not, but if you ask somewhere and are getting attention, then wait until one solution is done and if you need more handholding you can take that solution and use as a better background for the next question. 
how to change the contents of a specific textbox and a P tag in page1

var p = document.getElementById("p_id"); // with <p id="p_id"></p>
p.innerText = "Hello"; // check compatibility and more here : https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent

var textbox = document.getElementById("textbox1"); // <input type="text" id="textbox1" />
textbox.value = "hello";

Open in new window

try apply the concept of codes suggested by leakim971 above.

and then:

so far I manage to display text on the bottom of page1 using the called page2

you need to know in what element this text is being displayed, and then try grab its value to be used later.
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the help

Many people in this and other forum said that my question is not clear and needs more explanation

I can not see what is unclear in my question!

Page 1 has textbox or P tag or .....

how to change the contents of any of the listed items using page 2 without post back page 1

what is mysterious about my question

page1
<html>
<P id="abc">hellow</P>
</html>

Page2
<html>
?????how to change the content of P tag (hellow) in page 1 to make it (good bye)
</html>

That's it

The data source (good bye) is from the server

I have read that iframe is not a good idea, many advised to use xmlhttp.open and send with some delay (readyState)

I have a page that is full of info, only one line needs to be changed on demand e.g. currency, article, climate ..... etc

Post back for the full page is not a good idea

if this could be done on page 1 then fine, but many examples use page 2 to change page 1

Please tell if any thing unclear
Many people in this and other forum said that my question is not clear and needs more explanation

Well, a better understanding would assist in finding a better solution.

how to change the contents of any of the listed items using page 2 without post back page 1

are Page 1 and Page 2 hosted under the same domain name?

if this could be done on page 1 then fine, but many examples use page 2 to change page 1

That's a question on whether do you have enough privilege to amend Page 1 ?

Separately, in a "normal" scenario, if you got 2 separate HTML pages ( Page 1 and Page 2), they cannot co-exist/ co-loaded into your web browser, unless we are saying to use frames or iframe, etc to achieve that. But you have to tell us how you want to present these pages, OR actually you're not really want to display Page 1 as the output?
what is mysterious about my question
Until now you have not posted any code (other than the XHTTP function - which is not really the key bit - for us to reference. The requirement was vague without a concrete example of what we were being asked to solve.

You have subsequently been given a full working example showing you exactly how to solve this problem - but based on your last response (which seems to have ignored the previous post) it does not address your requirement - which indicates we need more information.

Please advise what is wrong with the working sample provided above?
Thanks for every one that participated in this question

Mr Julian,

I can see (P) tag and (Input) tag both to be changed by the  t3818.php


Thank you for your answer
You are welcome.