Home > front end >  The small white big solutions
The small white big solutions

Time:11-04

To give a website post parameter name on the w3c see again for a long time don't know what wrong is


<meta charset="utf-8"> Query httprequest & lt;/title> <script SRC="https://bbs.csdn.net/topics/jquery-1.11.2.js" type="text/javascript" charset="utf-8" & gt; </script> </meta> </head> <body> <The button id="bid" & gt; 123123 & lt;/button> <script type="text/javascript"> $(' # bid). Click (function () {$. Ajax ({url: 'http://clovert.top/mosAdvance',//address dataType: 'data',//data type type: "post",//type success: function (data, status) {alert (data);//alert (status); }})}) & lt;/script> </body> <br/></html> <br/><p class="article - content rp"> CodePudding user response: </p><pre> $(' # bid). Click (function () {<br/>$. Ajax ({<br/>Url: 'http://clovert.top/mosAdvance',//address <br/>Data: JSON. Stringify ({name: "123"}), <br/>DataType: "json", <br/>contentType: "application/json; Charset=utf-8, <br/>"Type: "post",//type <br/>Success: the function (data, status) {<br/>Alert (data);//alert (status); <br/>}, <br/>Error: function (e) {<br/>The console. The log (e) <br/>} <br/>}) <br/>}) </pre> <img SRC="https://img.codepudding.com/202011/158580040341431.jpg" Alt=""/><p class="article - content rp"> CodePudding user response: </p>If you want this effect <br/><br/>$(' # bid). Click (function () {<br/>Var path="122"; <br/>$. Ajax ({<br/>Url: 'http://clovert.top/mosAdvance',//address <br/>DataType: 'data',//data type <br/>Type: "post",//type <br/>Data: {name: "naem, filename: path}, <br/>Success: the function (data, status) {<br/>Alert (data);//alert (status); <br/>}}) <br/><br/><br/>})<p class="article - content rp"> CodePudding user response: </p>A post request to add data: "'//request parameters<p class="article - content rp"> CodePudding user response: </p><fieldset> <legend> refer to the second floor behavior response: <legend> <blockquote> if you want this effect <br/><br/>$(' # bid). Click (function () {<br/>Var path="122"; <br/>$. Ajax ({<br/>Url: 'http://clovert.top/mosAdvance',//address <br/>DataType: 'data',//data type <br/>Type: "post",//type <br/>Data: {name: "naem, filename: path}, <br/>Success: the function (data, status) {<br/>Alert (data);//alert (status); <br/>}}) <br/><br/><br/>}) </blockquote> <fieldset> the rightness of thank you bosses <img SRC="https://img.codepudding.com/202011/158580040341432.gif" Alt=""/><p class="article - content rp"> CodePudding user response: </p><fieldset> <legend> reference 1/f, the lakers' championship reply: <legend> <blockquote> <pre> $(' # bid). Click (function () {<br/>$. Ajax ({<br/>Url: 'http://clovert.top/mosAdvance',//address <br/>Data: JSON. Stringify ({name: "123"}), <br/>DataType: "json", <br/>contentType: "application/json; Charset=utf-8, <br/>"Type: "post",//type <br/>Success: the function (data, status) {<br/>Alert (data);//alert (status); <br/>}, <br/>Error: function (e) {<br/>The console. The log (e) <br/>} <br/>}) <br/>}) </pre> <img SRC="https://img.codepudding.com/202011/158580040341431.jpg" Alt=""/> </blockquote> <fieldset> thank you bosses. Why add json stringify?<p class="article - content rp"> CodePudding user response: </p><fieldset> <legend> reference 1/f, the lakers' championship reply: <legend> <blockquote> <pre> $(' # bid). Click (function () {<br/>$. Ajax ({<br/>Url: 'http://clovert.top/mosAdvance',//address <br/>Data: JSON. Stringify ({name: "123"}), <br/>DataType: "json", <br/>contentType: "application/json; Charset=utf-8, <br/>"Type: "post",//type <br/>Success: the function (data, status) {<br/>Alert (data);//alert (status); <br/>}, <br/>Error: function (e) {<br/>The console. The log (e) <br/>} <br/>}) <br/>}) </pre> <img SRC="https://img.codepudding.com/202011/158580040341431.jpg" Alt=""/> </blockquote> <fieldset> thank you bosses json is why </div> <div class="th_page th_page_color"></div> <div class="umCopyright"> <p>Page link:<a href="/frontend/77032.html" target="_blank" style="color:#999">https//www.codepudding.com/frontend/77032.html</a></p> </div> <div class="detail-arr"> <div class="detail-arr-left">Prev:<a href='/frontend/77031.html'>From small sprout new turn, shivering.</a></div> <div class="detail-arr-right">Next:<a href='/frontend/77033.html'>Add the line</a></div> </div> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="hot-tags neitags"> <ul> <li><i class="iconfont icon-x-tags"></i> Tags:  </li> <a href='/e/tags/?tagname=Ajax' target='_blank'>Ajax</a> </ul> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="xiangguan"> <ul class="msg msghead"> <li class="tbname">Related</li> </ul> <ul> </ul> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="flinks"> <ul> <li><i class="iconfont icon-x-tags"></i> Links:  </li> <li class="liflinks"><a target="_blank" href="/" title="CodePudding">CodePudding</a></li> </ul> </div> </div> </div> </div> <div class="footer"> <p><span style="font-size:16px;color:#666;font-weight: bold">About Us:</span>  <a href="https://www.codepudding.com/contact.html">Contact Us</a>      <a href="https://www.codepudding.com/service.html">Terms of Service</a>      <a href="https://www.codepudding.com/privacy.html"> Privacy Policy</a></p> <p class="foot_info">Copyright © 2010-2023,Powered By <a href="/" target="_blank">CodePudding</a> </p> </div> <script type="text/javascript" src="/skin/code/tianhu.js"></script> </body></html>