当前位置: 首页 > news >正文

郑州网站优化公司哪家好河南最新建设工程信息

郑州网站优化公司哪家好,河南最新建设工程信息,相亲网站认识的可以做朋友,轻芒小程序wordpress我试图一些时间间隔后改变一个div的内部HTML。 我得到我想要使用Ajax正确的反应。 但无法取代内HTML的后#xff0c;并用Ajax响应地选择。 什么是错我的代码..HTML51 seconds ago58 seconds ago.....10 minute agoĴ查询setInterval(function() {$( .time ).each(…我试图一些时间间隔后改变一个div的内部HTML。 我得到我想要使用Ajax正确的反应。 但无法取代内HTML的后并用Ajax响应地选择。 什么是错我的代码..HTML 51 seconds ago 58 seconds ago..... 10 minute agoĴ查询setInterval(function() {$( .time ).each(function( index ) {var sendTime $(this).attr(data-time);dataString sendtimesendTimeqconvertTime;$.ajax({type: POST,url: data_handler.php,data: dataString,cache: true,success: function(response) {alert(response);$(this).html(response);//alert(response);}});});}, 5000);Answer 1:this是在回调的窗口。 使用给予的价值callback每个$( .time ).each(function(index , elem) {var sendTime $(this).attr(data-time);dataString sendtimesendTimeqconvertTime;$.ajax({type: POST,url: data_handler.php,data: dataString,cache: true,success: function(response) {alert(response);$(elem).html(response);}});});你并不需要定义一个新的变量来保护this在jQuery已经为您完成。Answer 2:当您使用的是异步函数的回调 this在你的回调并非来自同一背景。 您需要保存this在回调中使用的变量。尝试这样的setInterval(function() {$( .time ).each(function( index ) {var sendTime $(this).attr(data-time);dataString sendtimesendTimeqconvertTime;var self this;$.ajax({type: POST,url: data_handler.php,data: dataString,cache: true,success: function(response) {alert(response);$(self).html(response);//alert(response);}});});}, 5000);Answer 3:我认为$(这)是断章取义。 尝试setInterval(function() {$( .time ).each(function( index ) {var $this $(this);var sendTime $(this).attr(data-time);dataString sendtimesendTimeqconvertTime;$.ajax({type: POST,url: data_handler.php,data: dataString,cache: true,success: function(response) {alert(response);$this.html(response);//alert(response);}});});}, 5000);Answer 4:setInterval(function() {$( .time ).each(function( index ) {var sendTime $(this).attr(data-time);var _thisvariable $(this);dataString sendtimesendTimeqconvertTime;$.ajax({type: POST,url: data_handler.php,data: dataString,cache: true,success: function(response) {alert(response);_thisvariable.html(response);//alert(response);}});});}, 5000);文章来源: Replace inner HTML of a div with Ajax response
http://www.yutouwan.com/news/430379/

相关文章:

  • 专门做钱币的网站网站建设顾问站建
  • 北京云建站模板wordpress移动端顶部导航栏
  • 西安整站优化做餐厅网站的需求分析报告
  • 邵阳市 网站建设怎么用asp.net做网站
  • 家具全屋定制龙华优化公司
  • 毕业设计网站wordpress房产主题汉化版
  • 建站高端网站网站建设修改建议书
  • 国家中小企业公共服务平台无线网络优化
  • 如何建设网站地图河源seo排名
  • 比较大的建站公司西安SEO网站排名
  • 中英文网站用同域名...温岭做网站
  • 网站开发工作进展情况动漫做的游戏 迅雷下载网站
  • 资讯类网站模板asp食品建设网站的目的
  • 建网站一般多少钱深圳也放开了
  • 网站开发语言有什么ps做网站图
  • 想建一个网站用jsp做网站登录界面模板
  • 兰州市城乡建设局网站s104项目网站访客qq抓取原理
  • 如何查网站是哪家公司做的wordpress register位置
  • 江苏省建设网站wordpress网页聊天工具
  • 网站建设多少钱专业如何设计软件界面
  • 建站公司分析引流推广的句子
  • 双语版网站怎么做群排名优化软件
  • 网站建设 思维导图用数字做域名的网站
  • 企业网站建设与推广多少钱中国工程项目网
  • 桐城建设规划局网站推广营销企业
  • google网站优化工具如何搭建一个论坛网站
  • 建一个在线商城网站dede做英文网站优化
  • 什么专业的会做网站广州公司网站建设公司
  • 长沙网站建设做得好的如何查询自己二建的状态
  • 服务器建设一个自己的网站网站建设网站建设的