insert content in a div of another page using client side
I have a page where开发者_StackOverflow社区 there is a form(and url is xyz.com/form)...
Now when the user submits the data, it should redirect to the home page of xyz.com(url is xyz.com) and then display a message as "Thank you" in an existing div id (div id="message")of the home page...
Is it possible to do it using javascript??
Will I get the value of that div id(message) when the it redirects to home page using javascript.
I could redirect the page to home page.. but couldnt insert contents in that div... or in a new div...
Please help
i would add a GET-parameter to the url like "status=ok". on the main-page you can check this parameter with javascript and change the value ('innerHTML') of the div.
Without having seen your code, i would say yes, it is possible.
On entering the main page you can check the referring page and you could also check some session stored data that validates if the user has submitted the form (i suggest ajax for this).
精彩评论