开发者

pass a var from one page to another

开发者 https://www.devze.com 2023-02-03 18:18 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消