pass a var from one page to another
I have a page (#1) that has an include of another page (#2). The second page contains a db query. I need to 开发者_StackOverflow社区be able to pass a message to the first page if there are no results. Can it be done with jQuery or something like innerHTML?
Would I need to put message container in page 1 and target that area from page 2?
Page #1
<div id="messageArea"></div>
Page #2
if ($error === true) {
$message = 'Message here';
}
UPDATE: The include is called with AJAX
Put the value in the query string and parse the query string on the receiving page.
精彩评论