jQuery插件jQuery-JSONP的开发ajax调用使用注意事项.pdfVIP

jQuery插件jQuery-JSONP的开发ajax调用使用注意事项.pdf

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
  4. 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
  5. 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们
  6. 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
  7. 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
jQuery插件jQuery-JSONP开发ajax调⽤使⽤注意事项 j Query-JSONP是⼀个⽀持 JSONP 调⽤的 j Query 插件,使⽤它是因为它⽀持出错时的 aj ax 回调,⽽ j Query 的 $.aj ax 不⽀持。 JSONP 调⽤⽰例代码: 代码如下: var originImgSrc = cnbogs-logo.gif; $.jsonp({ url: , data: { imgSrc: originImgSrc , callbackParameter: callback, success: function (newImgSrc, textStatus, xOptions) { console.log(xOptions.data.imgSrc); , error: function (xOptions, textStatus) { ); 第1个需 注意的地⽅是 callbackParameter ,如果没有专门的 callback 函数,⼀定 写 上 callback ; 第2个需 注意的地⽅是在 success 回调函数中,直接通过变量名 origi ImgSrc 得到的 是 u defi ed ,需 通过 xOptio s.data.imgSrc 获取。 JavaScript、jQuery与Ajax的关系 简单总结: 1、JS是⼀门前端语⾔。 2、Aj ax是⼀门技术,它提供了异步更新的机制,使⽤客户端与服务器间交换数据⽽ ⾮整个页⾯⽂档,实现页⾯的局部更新。 3、j Query是⼀个框架,它对JS进⾏了封装,使其更⽅便使⽤。j Query使得JS与Aj ax的 使⽤更⽅便 详细情况: Actually o ly o e of them is a programmi g la guage . Javascript is a programmi g la guage which is used mai ly i webpages for maki g websites i teractive . Whe a webpage is parsed by the browser , it creates a i -memory represe tatio of the page . It is a tree structure , which co tai s all eleme ts o the page . So there is a root eleme t , which co tai s the head a d the body eleme ts, which co tai other eleme ts, which co tai other eleme ts. So it looks like a tree basically . Now with j avascript you ca ma ipulate eleme ts i the page usi g this tree . You ca pick eleme ts by their id (getEleme tsById), or their tag ame (getEleme tsByTagName), or by simply goi g through the tree (pare tNode , firstChild , lastChild , extSibli g , previousSibli g , etc .) . O ce you have eleme t(s) to work with you ca modify them by cha gi g their look , co te t or positio o the page . This i terface is also k ow as the DOM(Docume t Object Model) . So you ca do everythi g with Javascript that a other programmi g la guage ca do , a d by usi g it embedded i to wepag

文档评论(0)

xina171127 + 关注
实名认证
文档贡献者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档