开发者

onclick .load() 2 variables

开发者 https://www.devze.com 2023-02-03 11:52 出处:网络
Using开发者_JAVA技巧 this script to send id to file.php which queries database and returns output in #DIV,

Using开发者_JAVA技巧 this script to send id to file.php which queries database and returns output in #DIV,

function recp(id + page) {

 $('#DIV').load('file.php?id=' + id + '& page=' + page);

}

works fine with just (id) but no luck with 2 variables. Checked on the appropriate sites without any result.

How would I also configure my Onclick=recp('$id ...')

Help much appreciated!


There is a space in your query string. It should be:

$('#DIV').load('file.php?id=' + id + '&page=' + page);

It is much neater to pass an object as second [data] parameter:

$('#DIV').load('file.php', {id: id, page: page});
0

精彩评论

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