随着互联网时代的发展,web前端已经和后台数据挂钩,作为web前端仅仅不是只切图写写html,css 和简单js交互。
js code
$(function() { var page = 1; var discount = $('#discount'); var innerHeight = window.innerHeight; var timer2 = null; $.ajax({ url: '/lightapp/marketing/verify/apply/list?page=1', type: 'GET', dataType: 'json', timeout: '1000', cache: 'false', success: function (data) { if (data.error_code === 0) { var arrText = []; for (var i = 0, t; t = data.list[i++];) { arrText.push('<div class="consume-whole">'); arrText.push('<h3 id="t-title">' + t.title + '</h3>'); if (t.coupon_type == 1 ) { arrText.push('<p>金额:¥' + t.amount + '</p>'); } else { arrText.push('<p>优惠:' + t.amount + '</p>'); } arrText.push('<p><span class="hx-user">用户:s账户飒飒是是是啊啊12' + t.user_name +'</span>' + '<span>核销时间:' + t.use_time + '</span></p>'); arrText.push('</div>'); } discount.html(arrText.join('')); }; var ajax_getting = false; $(window).scroll(function() { clearTimeout(timer2); timer2 = setTimeout(function() { var scrollTop = $(document.body).scrollTop(); var scrollHeight = $('body').height(); var windowHeight = innerHeight; var scrollWhole = Math.max(scrollHeight - scrollTop - windowHeight); if (scrollWhole < 100) { if (ajax_getting) { return false; } else { ajax_getting = true; } discount.append('<div class="load"><img src="/static/imghwm/default1.png" data-src="/lightapp/static/zhida-yunying/img/load.gif" class="lazy" style="max-width:90%" / alt="jQuery+AJAX实现无刷新下拉加载更多_jquery" ></div>'); $('html,body').scrollTop($(window).height() + $(document).height()); page++; $.ajax({ url: '/lightapp/marketing/verify/apply/list?page=' + page, type: 'GET', dataType: 'json', success: function (data) { if (data.error_code === 0) { var arrText = []; for (var i = 0, t; t = data.list[i++];) { arrText.push('<div class="consume-whole"><a href="/lightapp/marketing/verify/page/info?rule_id=' + t.rule_id + '&coupon_id='+ t.coupon_id +'">'); arrText.push('<h3 id="t-title">' + t.title + '</h3>'); if (t.coupon_type == 1 ) { arrText.push('<p>金额:¥' + t.amount + '</p>'); } else { arrText.push('<p>优惠:' + t.amount + '</p>'); }; arrText.push('<p><span class="hx-user">用户:账户飒111111111' + t.user_name +'</span>' + '<span>核销时间:' + t.use_time + '</span></p>'); arrText.push('</a></div>'); } discount.append(arrText.join('')); $(".load").remove(); } else { $(".load").remove(); discount.append('<div class="no-data">没有更多数据。</div>'); $(window).unbind('scroll'); }; ajax_getting = false; } }); }; $(".load").remove(); }, 200); }); if (data.error_code == 156006) { $('.coupon').html('<div class="error"><h2 id="出错啦">出错啦!</h2><p>原因:未登录</p></div>') }; if (data.error_code == 156003) { $('.coupon').html('<div class="error"><h2 id="出错啦">出错啦!</h2><p>原因:权限不足~请补充</p></div>') }; if (data.error_code == 156007) { $('.coupon').html('<div class="error"><h2 id="出错啦">出错啦!</h2><p>原因:服务异常</p></div>') }; if (data.error_code == 511) { $('.coupon').html('<div class="error"><h2 id="出错啦">出错啦!</h2><p>原因:账号未开通直达号</p></div>') }; if (data.error_code == 520) { $('.coupon').html('<div class="stays"><span></span><p>暂无核销记录</p></div>') } }, error: function (data) { } }) $(window).bind("orientationchange", function() { $('.sliders').css('left',$(window).width() / 2 +'px'); }) })
以上所述就是本文的全部内容了,希望大家能够喜欢。

javaandjavascriptaredistinctlanguages:javaisusedforenterpriseandmobileapps,while javascriptifforInteractiveWebpages.1)JavaisComcompoppored,statieldinglationallyTypted,statilly tater astrunsonjvm.2)

JavaScript核心数据类型在浏览器和Node.js中一致,但处理方式和额外类型有所不同。1)全局对象在浏览器中为window,在Node.js中为global。2)Node.js独有Buffer对象,用于处理二进制数据。3)性能和时间处理在两者间也有差异,需根据环境调整代码。

JavaScriptusestwotypesofcomments:single-line(//)andmulti-line(//).1)Use//forquicknotesorsingle-lineexplanations.2)Use//forlongerexplanationsorcommentingoutblocksofcode.Commentsshouldexplainthe'why',notthe'what',andbeplacedabovetherelevantcodeforclari

Python和JavaScript的主要区别在于类型系统和应用场景。1.Python使用动态类型,适合科学计算和数据分析。2.JavaScript采用弱类型,广泛用于前端和全栈开发。两者在异步编程和性能优化上各有优势,选择时应根据项目需求决定。

选择Python还是JavaScript取决于项目类型:1)数据科学和自动化任务选择Python;2)前端和全栈开发选择JavaScript。Python因其在数据处理和自动化方面的强大库而备受青睐,而JavaScript则因其在网页交互和全栈开发中的优势而不可或缺。

Python和JavaScript各有优势,选择取决于项目需求和个人偏好。1.Python易学,语法简洁,适用于数据科学和后端开发,但执行速度较慢。2.JavaScript在前端开发中无处不在,异步编程能力强,Node.js使其适用于全栈开发,但语法可能复杂且易出错。

javascriptisnotbuiltoncorc; saninterpretedlanguagethatrunsonenginesoftenwritteninc.1)javascriptwasdesignedAsalightweight,解释edganguageforwebbrowsers.2)Enginesevolvedfromsimpleterterterpretpreterterterpretertestojitcompilerers,典型地提示。

JavaScript可用于前端和后端开发。前端通过DOM操作增强用户体验,后端通过Node.js处理服务器任务。1.前端示例:改变网页文本内容。2.后端示例:创建Node.js服务器。


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

Video Face Swap
使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章

热工具

SublimeText3 Linux新版
SublimeText3 Linux最新版

SublimeText3 英文版
推荐:为Win版本,支持代码提示!

记事本++7.3.1
好用且免费的代码编辑器

PhpStorm Mac 版本
最新(2018.2.1 )专业的PHP集成开发工具

安全考试浏览器
Safe Exam Browser是一个安全的浏览器环境,用于安全地进行在线考试。该软件将任何计算机变成一个安全的工作站。它控制对任何实用工具的访问,并防止学生使用未经授权的资源。