[页面滚动到底部]jquery $(window).height()取值等于$(document).height()的问题

本文解决了JSP页面中因DOCTYPE声明位置不当导致的问题。通过调整DOCTYPE在JS引用文件的位置,成功避免了HTML解析错误。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

问题现象:JSP中头部引用了某个head.jsp,在videoList.jsp中生成片段时如下

 

 

 

实际最终生成的HTML如下:

 

 

<!DOCTYPE html>没有解析到,原因找到了,先想办法怎么解决

 

解决办法:

将<!DOCTYPE html>放到JS引用文件前面

<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!doctype html><!--现位置-->
<%@include file="../common/common.jsp" %>
<script type="text/javascript" src="${base}/js/jquery-1.9.0.min.js?v=${version_js}"></script>
<!--<!doctype html> 原位置-->
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta charset="utf-8">
<title>视频列表</title>
<%-- <link type="text/css" href="${base}/css/common.css" rel="stylesheet" /> --%>
<link type="text/css" rel="stylesheet" href="${base}/css/mobile.css">
<link type="text/css" rel="stylesheet" href="${base}/css/xincapApp.css">
<script type="text/javascript" src="${base}/js/xincapApp.js"></script>

 

问题解决啦!

 

转载于:https://www.cnblogs.com/zhixi/p/4962373.html

function orderquery(out_trade_no){ var out_trade_no=out_trade_no; $.post("/wxpay/orderquery.html",{out_trade_no:out_trade_no},function(data){ if(data==1){ parent.window.location.href="https://www.jiaobu365.com/index/pay/paytype/6.html"; } }); } $(function () { // tip提示 var tip $(document).on('mouseover', '.help', function () { var that = this; tip = layer.tips('PPT简历/PPT模板/PPT图表/word模板/Excel模板/范文模板', that, { tips: [1, '#333'], time: 0 }); }); $(document).on('mouseleave', '.help', function () { layer.close(tip) }); // levelChange(2) //下载在线制作简历 $(document).on('click', '#down_onlineresume', function () { levelChange(2) }); //下载简历 $(document).on('click', '#down_word_resume', function () { levelChange(2) }); //下载自由编辑简历 $(document).on('click', '#down_freeresume', function () { levelChange(2) }); // 等级切换 $(document).on('click', '.vip-pop .main .group .item', function () { var index = $(this).index() clearInterval(t_index); levelChange(index) }); var trade_sn = ''; function levelChange (index) { var activeIndex = $('.vip-pop .main .group .item.active').index() if (index !== activeIndex) { var $active = $('.vip-pop .main .group .item').eq(index) $active.addClass('active').siblings().removeClass('active') // var title = $active.find('.titles').text() // $('.vip-pop .side .level').text(title) var intro = $active.find('.intro').html() $('.vip-pop .side .intro').html(intro) var price = $active.find('.price .number').text() $('.vip-pop .main .con .price .number').text(price) // 在这里根据会员类型刷新二维码 //paytype=3表示vip var paytype = 3 //payment=2表示微信 这里暂时传2 var payment = 2 //amount表示会员类型,传到后台以后再计算出相应价格 var amount = $active.data('type') var orderstr = $("#orderstr").val(); $('.vip-pop .main .con .qr').html('') $.ajax({ type:'post', url:"/paynew/dopay.html", data:{'paytype':paytype,'payment':payment,'amount':amount,'orderstr':orderstr}, success: function (result) { //微信 var url = result.code_url; //参数1表示图像大小,取值范围1-10;参数2表示质量,取值范围'L','M','Q','H' var qr = qrcode(10, 'M'); qr.addData(url); qr.make(); var code=document.createElement('DIV'); code.innerHTML = qr.createImgTag(); var element=document.getElementById("wechat"); element.appendChild(code); //支付宝 var infromurl = '<iframe id="iframezf" src="'+result.alipay.url+'" frameborder="0" width="100%" height="132px"></iframe>'; $("#zfb").empty().append(infromurl); trade_sn = result.alipay.trade_sn; console.log(trade_sn) t_index = setInterval(function () { orderquery(trade_sn)}, 3000); } }); } } });
最新发布
03-13
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值