織夢ajax跨域提交自定義表單和跨域驗證碼問題織
導讀:織夢技巧織夢技巧A站(www.a.com),有個form表單,ajax提交到 B站(www.b.com),還附帶個驗證碼 A站上的表單代碼如下 script type = teseo網站排名優化軟件seo網站優化軟件。
A站(www.a.com),有個form表單,ajax提交到 B站(www.b.com),還附帶個驗證碼 A站上的表單代碼如下 script type = text/javascript src = http://apps.bdimg.com/libs/jquery/1.6.4/jquery.min.js / script script function send () { $.ajax({ cache : true , type : POST , url : http://www.b.com/plus/ […]
A站(www.a.com),有個form表單,ajax提交到 B站(www.b.com),還附帶個驗證碼
A站上的表單代碼如下
<script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/1.6.4/jquery.min.js"></script> <script> function send(){ $.ajax({ cache:true, type:"POST", url:"http://www.b.com/plus/diy.php", data:$('#diyform').serialize(), xhrFields:{withCredentials: true}, //ajax跨域提交需要 crossDomain:true, //ajax跨域提交需要 success: function(data){ if(data=="success"){ alert('發送成功!'); }else{ alert('發送失敗!'); } } }); } </script> <form action="" enctype="multipart/form-data" method="post" id="diyform"> <i高端網站建設nput type="hidden" name="action" value="post" /> <input type="hidden" name="diyid" value="2" /> <input type="hidden" name="do" value="2" /> <input type="hidden" name="dede_fields" value="name,text" /> <input type="hidden" name="dede_fields如何seo優化推廣網站hash" value="c2be5bb5ec45d9d01ca9f60dc469b3fb" /> <p> 姓名: <input type='text' name='name' id='name' /> </p> <p> 驗證碼: <input type="text" name="validate"><img src="http://www.b.com/include/vdimgck.php" align="absmiddle" onclick="this.src='http://www.b.com/include/vdimgck.php?tag='+Math.random();" style="cursor:pointer;"> </p> <div onclick="send()">提交</div> </form>1、提交到 http://www.b.com/plus/diy.php
2、驗證碼 http://www.b.com/incl網站建設ude/vdimgck.php
3、ajax 跨域必需js代碼
聲明: 本文由我的SEOUC技術文章主頁發布于:2023-05-25 ,文章織夢ajax跨域提交自定義表單和跨域驗證碼問題織主要講述自定義,驗證碼,織夢網站建設源碼以及服務器配置搭建相關技術文章。轉載請保留鏈接: http://www.bifwcx.com/article/web_8268.html