开发者社区> 问答> 正文

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 4025 0
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
    赞同 展开评论 打赏
问答分类:
问答地址:
相关产品:
问答排行榜
最热
最新

相关课程

更多

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载