请教我使用加网jsapi接口,在微网站里无法执行$.ajax
本帖最后由 yang131261 于 2014-04-19 09:16:14 编辑 我使用加网js的api接口 中的自定义函数 无法执行$.ajax sucess 或 error 都不输出
<script><br />function ccd(evt){<br /> var url3 = "http://xxxxx/index.php?g=Wap&m=Card&a=ajax_fenxiang3";<br /> // var url2 = "{lanrain::U('Card/ajax_fenxiang',array('token'=>$_GET['token'],'wecha_id'=>$_GET['wecha_id']))}";<br /> $.ajax({<br /> type: "GET",<br /> url: url3,<br /> contentType: "application/json; charset=utf-8",<br /> dataType: "json",<br /> success: function (result) {<br /> alert(111);<br /> },<br /> error: function (msg) {<br /> alert(333);<br /> }<br /> })<br /> <br /><br />}<br /> <br />var jiathis_config = {<br /> boldNum:0,<br /> siteNum:7,<br /> showClose:false,<br /> sm:"t163,kaixin001,renren,douban,tsina,tqq,tsohu",<br /> imageUrl:"http://v2.jiathis.com/code/images/r5.gif",<br /> imageWidth:26,<br /> marginTop:150,<br /> url:"http://www.jiathis.com",<br /> title:"自定义TITLE #微博话题#",<br /> summary:"分享的文本摘要",<br /> pic:"自定义分享的图片连接地址",<br /> data_track_clickback:true,<br /> evt: {"share":"ccd"}<br />}<br /></script>
Copy after login
<br /><!-- JiaThis Button BEGIN --><br /><div class="jiathis_style"><br /> <a class="jiathis_button_qzone"></a><br /> <a class="jiathis_button_tsina"></a><br /> <a class="jiathis_button_tqq"></a><br /> <a class="jiathis_button_weixin"></a><br /> <a class="jiathis_button_renren"></a><br /> <a class="jiathis_button_xiaoyou"></a><br /> <a href="http://www.jiathis.com/share" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank"></a><br /> <a class="jiathis_counter_style"></a><br /><script type="text/javascript" src="http://v3.jiathis.com/code/jia.js" charset="utf-8"></script><br /></div>
Copy after login
------解决方案--------------------去掉
contentType: "application/json; charset=utf-8",