[英]if page link is like test.html?a=1&b=2 then how load function will work getting value of a and load particular div?
我的 html 页面是:
test.php?a=1&b=2
当响应回调到 post.php 然后是 test.php 时,将响应发送到post.php
然后是abc.php
。 ( test.php
-> post.php
-> abc.php
) 发送 ( abc.php
-> post.php
-> test.php
) 接收test.php
是主页post.php
和abc.php
都是 jquery 响应页面
加载函数将如何在我的页面中包含$_GET
值?
当我使用这个时:
$("#div").load("test.php #div")
结果:它只是用数据加载 div 而没有得到a
和b
值
$.ajax({
method: "POST",
url: "abc.php",
data: dataString
})
.done(function( msg ) {
$("#div").load("test.php?a="+xx+ "#div");
}
在abc.php
页面中,我在 echo 中发送a
值,如echo $xx;
这个回声只是为了得到a
值 响应数据正在与这个$("#div").load("test.php #div")
会话中获取会话数据,因为它是特定 div 上的购物车项目
但是当我使用这样的东西时
$("#div").load("test.php?a="+xx+ "#div");
结果:它在那个div
加载whole page
,而just div load
但是我得到了a
值
我想要a
值, only div load
而不是whole page
你需要使用 $("#div").html('whatever div content should be')。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.