Heim  >  Artikel  >  Backend-Entwicklung  >  请教我使用加网jsapi接口,在微网站里无法执行$.ajax

请教我使用加网jsapi接口,在微网站里无法执行$.ajax

WBOY
WBOYOriginal
2016-06-23 13:58:31978Durchsuche

我使用加网js的api接口 中的自定义函数 无法执行$.ajax   sucess 或 error 都不输出

<script>function ccd(evt){        var url3 = "http://xxxxx/index.php?g=Wap&m=Card&a=ajax_fenxiang3";        // var url2 = "{lanrain::U('Card/ajax_fenxiang',array('token'=>$_GET['token'],'wecha_id'=>$_GET['wecha_id']))}";                 $.ajax({				          type: "GET",						  url: url3,						  contentType: "application/json; charset=utf-8",						  dataType: "json",						  success: function (result) {						     alert(111);                          },						  error: function (msg) {								alert(333);					      }				 })				}	var jiathis_config = {    boldNum:0,    siteNum:7,    showClose:false,    sm:"t163,kaixin001,renren,douban,tsina,tqq,tsohu",    imageUrl:"http://v2.jiathis.com/code/images/r5.gif",    imageWidth:26,    marginTop:150,    url:"http://www.jiathis.com",    title:"自定义TITLE #微博话题#",    summary:"分享的文本摘要",    pic:"自定义分享的图片连接地址",    data_track_clickback:true,    evt: {"share":"ccd"}}</script>

<!-- JiaThis Button BEGIN --><div class="jiathis_style">	<a class="jiathis_button_qzone"></a>	<a class="jiathis_button_tsina"></a>	<a class="jiathis_button_tqq"></a>	<a class="jiathis_button_weixin"></a>	<a class="jiathis_button_renren"></a>	<a class="jiathis_button_xiaoyou"></a>	<a href="http://www.jiathis.com/share" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank"></a>	<a class="jiathis_counter_style"></a><script type="text/javascript" src="http://v3.jiathis.com/code/jia.js" charset="utf-8"></script></div>


回复讨论(解决方案)

去掉
contentType: "application/json; charset=utf-8",

谢谢斑竹的热心帮忙

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn