开发者社区 问答 正文

jQuery $.post方法传带有参数的值,并返回一个div在本页面某一div打开

<div class="much1" id="much1">
                <a href="CheckState.php?state=1" ><strong>123</strong></a><br />
                <span class="font">正读</span>
</div>

这段js还有错误,加上以后我的整个js都不起作用了。

<pre class="brush:js; toolbar: true; auto-links: false;">$("#much1 a").click(function(){</pre><pre class="brush:js; toolbar: true; auto-links: false;">       //   var requestData = {state: $(this).text()};
          $.post('CheckState.php',{ state: "1" },function(){
          $('#center_right').load('CheckState.php');
          );
          return false;
 
  });</pre>

展开
收起
a123456678 2016-07-06 15:09:39 4143 分享
分享
版权
举报
1 条回答
写回答
取消 提交回答
  • 首先强调一下post方法:jQuery.post(url, [data], [callback], [type])

    url:发送请求地址。

    data:待发送 Key/value 参数。

    callback:发送成功时回调函数。

    type:返回内容格式,xml, html, script, json, text, _default

    post方法中的参数,数字参数可以不用加引号,回调函数只有在请求成功的时候才会调用,请求不成功就不会执行。而且我印象中,在页面中写入js代码,需要在

    2019-07-17 19:52:10 举报
    赞同 评论

    评论

    全部评论 (0)

    登录后可评论
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等