safari reload blank

本文描述了一个在Safari浏览器中遇到的问题:当网页源代码中包含空的<script language=javascript></script>标签时,虽然可以正常打开网页,但在刷新页面时会显示为空白。
在html中写了空的<script language="javascript"> </script>
可以在safari中打开网页,但是reload的时候显示空白页。
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>随借备用金 - 嵌套页面</title> <style> body, html { margin: 0; padding: 0; height: 100%; overflow: hidden; } #container { position: relative; width: 100%; height: 100%; } iframe { border: none; width: 100%; height: 100%; } .loading-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: #1A1A1A; display: flex; justify-content: center; align-items: center; z-index: 100; } .loading-spinner { width: 40px; height: 40px; border: 4px solid rgba(255, 200, 145, 0.3); border-top: 4px solid #FFAD5D; border-radius: 50%; animation: spin 1s linear infinite; } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } </style> </head> <body> <div id="container"> <!-- 加载动画 --> <div class="loading-overlay" id="loadingOverlay"> <div class="loading-spinner"></div> </div> <!-- 嵌套的iframe --> <iframe src="https://d1.hdncxd.com/s/new-colSbj?callback=__CALLBACK__" id="contentFrame" allow="fullscreen"></iframe> </div> <script> // 等待iframe加载完成后隐藏加载动画 document.getElementById('contentFrame').addEventListener('load', function() { document.getElementById('loadingOverlay').style.display = 'none'; // 额外处理:确保iframe可以全屏显示 try { this.contentWindow.focus(); } catch(e) { console.log('跨域限制,无法直接操作iframe内容'); } }); // 如果加载失败的处理 document.getElementById('contentFrame').addEventListener('error', function() { document.getElementById('loadingOverlay').innerHTML = '<div style="color: #FFAD5D; text-align: center; padding: 20px;">' + '<p>页面加载失败</p>' + '<button onclick="window.location.reload()" style="background: #FFAD5D; color: white; border: none; padding: 10px 20px; border-radius: 5px; margin-top: 10px;">重新加载</button>' + '</div>'; }); </script> </body> </html> 帮我改好 ios上点击嵌套的页面为啥跳转不了 安卓上就可以
08-27
//notation: js file can only use this kind of comments //since comments will cause error when use in webview.loadurl, //comments will be remove by java use regexp (function() { if (window.WebViewJavascriptBridge && window.WebViewJavascriptBridge.inited) { return; } var receiveMessageQueue = []; var messageHandlers = {}; var sendMessageQueue = []; var responseCallbacks = {}; var persistentCallbacks = {}; var uniqueId = 1; var lastCallTime = 0; var stoId = null; var FETCH_QUEUE_INTERVAL = 20; var messagingIframe; var CUSTOM_PROTOCOL_SCHEME = "yy"; var QUEUE_HAS_MESSAGE = "__QUEUE_MESSAGE__"; // 创建消息index队列iframe function _createQueueReadyIframe() { messagingIframe = document.createElement('iframe'); messagingIframe.style.display = 'none'; messagingIframe.src = CUSTOM_PROTOCOL_SCHEME + '://' + QUEUE_HAS_MESSAGE; document.documentElement.appendChild(messagingIframe); } //创建消息体队列iframe function _createQueueReadyIframe4biz() { bizMessagingIframe = document.createElement('iframe'); bizMessagingIframe.style.display = 'none'; document.documentElement.appendChild(bizMessagingIframe); } //set default messageHandler 初始化默认的消息线程 function init(messageHandler) { console.log(222222222222222); if (WebViewJavascriptBridge._messageHandler) { throw new Error('WebViewJavascriptBridge.init called twice'); } _createQueueReadyIframe(); _createQueueReadyIframe4biz(); WebViewJavascriptBridge._messageHandler = messageHandler; var receivedMessages = receiveMessageQueue; receiveMessageQueue = null; for (var i = 0; i < receivedMessages.length; i++) { _dispatchMessageFromNative(receivedMessages[i]); } WebViewJavascriptBridge.inited = true; } // 发送 function send(data, responseCallback) { _doSend('send', data, responseCallback); } // 注册线程 往数组里面添加值 function registerHandler(handlerName, handler) { messageHandlers[handlerName] = handler; } function removeHandler(handlerName, handler) { delete messageHandlers[handlerName]; } // Register a persistent callback that won't be deleted after first use function registerPersistentCallback(callbackId, callback) { persistentCallbacks[callbackId] = callback; responseCallbacks[callbackId] = callback; } // Remove a persistent callback function removePersistentCallback(callbackId) { delete persistentCallbacks[callbackId]; delete responseCallbacks[callbackId]; } // 调用线程 function callHandler(handlerName, data, responseCallback, persistent) { // 如果方法不需要参数,只有回调函数,简化JS中的调用 console.log(11111111111); if (arguments.length == 2 && typeof data == 'function') { responseCallback = data; data = null; } _doSend(handlerName, data, responseCallback, persistent); } // Call handler with persistent callback that can be reused function callHandlerPersistent(handlerName, data, responseCallback) { if (arguments.length == 2 && typeof data == 'function') { responseCallback = data; data = null; } _doSend(handlerName, data, responseCallback, true); } //sendMessage add message, 触发native处理 sendMessage function _doSend(handlerName, message, responseCallback, persistent) { var callbackId; console.log(1); if(typeof responseCallback === 'string'){ console.log(2); callbackId = responseCallback; } else if (responseCallback) { console.log(3); callbackId = 'cb_' + (uniqueId++) + '_' + new Date().getTime(); responseCallbacks[callbackId] = responseCallback; if (persistent) { persistentCallbacks[callbackId] = responseCallback; } message.callbackId = callbackId; }else{ console.log(4); callbackId = ''; } try { console.log(5); var fn = eval('WebViewJavascriptBridge.' + handlerName); } catch(e) { console.log(e); } if (typeof fn === 'function'){ console.log(6); var responseData = fn.call(WebViewJavascriptBridge, JSON.stringify(message), callbackId); if(responseData){ console.log(7); responseCallback = responseCallbacks[callbackId]; if (!responseCallback) { console.log(8); return; } responseCallback(responseData); // Only delete if it's not a persistent callback if (!persistentCallbacks[callbackId]) { console.log(9); delete responseCallbacks[callbackId]; } } } sendMessageQueue.push(message); messagingIframe.src = CUSTOM_PROTOCOL_SCHEME + '://' + QUEUE_HAS_MESSAGE; } // 提供给native调用,该函数作用:获取sendMessageQueue返回给native,由于android不能直接获取返回的内容,所以使用url shouldOverrideUrlLoading 的方式返回内容 function _fetchQueue() { // 空数组直接返回 if (sendMessageQueue.length === 0) { return; } // _fetchQueue 的调用间隔过短,延迟调用 if (new Date().getTime() - lastCallTime < FETCH_QUEUE_INTERVAL) { if (!stoId) { stoId = setTimeout(_fetchQueue, FETCH_QUEUE_INTERVAL); } return; } lastCallTime = new Date().getTime(); stoId = null; var messageQueueString = JSON.stringify(sendMessageQueue); sendMessageQueue = []; //android can't read directly the return data, so we can reload iframe src to communicate with java bizMessagingIframe.src = CUSTOM_PROTOCOL_SCHEME + '://return/_fetchQueue/' + encodeURIComponent(messageQueueString); } //提供给native使用, function _dispatchMessageFromNative(messageJSON) { setTimeout(function() { var message = JSON.parse(messageJSON); var responseCallback; //java call finished, now need to call js callback function if (message.responseId) { responseCallback = responseCallbacks[message.responseId]; if (!responseCallback) { return; } responseCallback(message.responseData); // Only delete if it's not a persistent callback if (!persistentCallbacks[message.responseId]) { delete responseCallbacks[message.responseId]; } } else { //直接发送 if (message.callbackId) { var callbackResponseId = message.callbackId; responseCallback = function(responseData) { _doSend('response', responseData, callbackResponseId); }; } var handler = WebViewJavascriptBridge._messageHandler; if (message.handlerName) { handler = messageHandlers[message.handlerName]; } //查找指定handler try { handler(message.data, responseCallback); } catch (exception) { if (typeof console != 'undefined') { console.log("WebViewJavascriptBridge: WARNING: javascript handler threw.", message, exception); } } } }); } //提供给native调用,receiveMessageQueue 在会在页面加载完后赋值为null,所以 function _handleMessageFromNative(messageJSON) { if (receiveMessageQueue) { receiveMessageQueue.push(messageJSON); } _dispatchMessageFromNative(messageJSON); } WebViewJavascriptBridge.init = init; WebViewJavascriptBridge.doSend = send; WebViewJavascriptBridge.registerHandler = registerHandler; WebViewJavascriptBridge.removeHandler = removeHandler; WebViewJavascriptBridge.callHandler = callHandler; WebViewJavascriptBridge.callHandlerPersistent = callHandlerPersistent; WebViewJavascriptBridge.registerPersistentCallback = registerPersistentCallback; WebViewJavascriptBridge.removePersistentCallback = removePersistentCallback; WebViewJavascriptBridge._handleMessageFromNative = _handleMessageFromNative; WebViewJavascriptBridge._fetchQueue = _fetchQueue; var readyEvent = document.createEvent('Events'); var jobs = window.WVJBCallbacks || []; readyEvent.initEvent('WebViewJavascriptBridgeReady'); readyEvent.bridge = WebViewJavascriptBridge; window.WVJBCallbacks = []; jobs.forEach(function (job) { job(WebViewJavascriptBridge) }); document.dispatchEvent(readyEvent); })(); public static void webViewLoadLocalJs(WebView view, String path){ String jsContent = assetFile2Str(view.getContext(), path); view.loadUrl("javascript:" + jsContent); } public static String assetFile2Str(Context c, String urlStr){ InputStream in = null; try{ in = c.getAssets().open(urlStr); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(in)); String line = null; StringBuilder sb = new StringBuilder(); do { line = bufferedReader.readLine(); if (line != null && !line.matches("^\\s*\\/\\/.*")) { sb.append(line); } } while (line != null); bufferedReader.close(); in.close(); return sb.toString(); } catch (Exception e) { e.printStackTrace(); } finally { if(in != null) { try { in.close(); } catch (IOException e) { } } } return null; }注入.js文件报 Uncaught ReferenceError: WebViewJavascriptBridge is not defined -- From line 1 of 发现错误: Uncaught ReferenceError: WebViewJavascriptBridge is not defined https://pv-mall.wuyang-honda.com/h5/#/ 1 6553 ReferenceError: WebViewJavascriptBridge is not defined -- From line 79 of https://pv-mall.wuyang-honda.com/h5/assets/index-EaCfmwlF.js Uncaught ReferenceError: WebViewJavascriptBridge is not defined -- From line 1 of https://pv-mall.wuyang-honda.com/h5/#/ [system] Location: https://pv-mall.wuyang-honda.com/h5/#/ -- From line 10 of https://pv-mall.wuyang-honda.com/h5/assets/vconsole.min-QVp8m_0m.js [system] Client: Android 12 -- From line 10 of https://pv-mall.wuyang-honda.com/h5/assets/vconsole.min-QVp8m_0m.js [system] UA: Mozilla/5.0 (Linux; Android 12; ALN-AL00 Build/HUAWEIALN-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/114.0.5735.196 Mobile Safari/537.36 Honda_ANDROIDAPP -- From line 10 of https://pv-mall.wuyang-honda.com/h5/assets/vconsole.min-QVp8m_0m.js
07-04
<form id="inputForm" action="update.jhtml" method="post" type="ajax" validate-type="validate" style="width: 100%"> <input type="hidden" name="id" value="${followUpRecord.id}" /> <div class="tabContent"> <table class="input input-edit"> <tr> <th> <span class="requiredField">*</span>${message("跟进类型")}: </th> <td colspan="2"> <select class="text followType" name="followType" id="followType" required btn-fun="clear"> <option value="">--请选择--</option> <option value="1" [#if followUpRecord.followType == 1] selected [/#if]>商机跟进</option> <option value="2" [#if followUpRecord.followType == 2] selected [/#if]>客户跟进</option> </select> </td> <th> <span class="requiredField">*</span>${message("跟进对象")}: </th> <td colspan="2"> <span class="search" style="position:relative"> <input type="hidden" id="objId" name="objId" class="text objId" value="${followUpRecord.objId}" btn-fun="clear" required/> <input type="text" id="objName" name="objName" class="text objName" value="${followUpRecord.objName}" onkeyup="clearSelect(this)" required/> <input type="button" class="iconSearch" value="" id="selectObj"> </span> </td> <th class="t_projectStageValue" style="display: none;"> ${message("商机阶段")}: </th> <td class="t_projectStageValue" style="display: none;"> <input type="text" name="projectStageValue" class="text projectStageValue" maxlength="200" value="${followUpRecord.projectStageValue}"/> </td> <th> <span class="requiredField">*</span>${message("状态")}: </th> <td colspan="2"> <select class="text recordStatus" name="recordStatus" required btn-fun="clear" style="pointer-events: none;background-color: #f7f7f7"> <option value="1" [#if followUpRecord.recordStatus == 1] selected [/#if]>未提交</option> <option value="2" [#if followUpRecord.recordStatus == 2] selected [/#if]>已提交</option> <option value="3" [#if followUpRecord.recordStatus == 3] selected [/#if]>审批中</option> </select> </td> </tr> <tr> <th> ${message("标段划分")}: </th> <td> <input type="text" name="sectionDivision" class="text sectionDivision" maxlength="200" /> </td> <th> ${message("跟进阶段")}: </th> <td> <select class="text followUpState" name="followUpState" id="followUpState" required btn-fun="clear"> <option value="">--请选择--</option> [#list followUpStates as followUpState] <option value="${followUpState.value}" [#if followUpRecord.followUpState == followUpState.value] selected [/#if] >${followUpState.remark}</option> [/#list] [#-- <option value="1" [#if followUpRecord.followUpState == 1] selected [/#if]>发现阶段</option>--] [#-- <option value="2" [#if followUpRecord.followUpState == 2] selected [/#if]>客户接触阶段</option>--] [#-- <option value="3" [#if followUpRecord.followUpState == 3] selected [/#if]>需求了解阶段</option>--] [#-- <option value="4" [#if followUpRecord.followUpState == 4] selected [/#if]>评估阶段</option>--] </select> </td> <th> ${message("是否关闭商机")}: </th> <td> <select class="text isCloseNiche" name="isCloseNiche" id="isCloseNiche" required btn-fun="clear"> <option value="">--请选择--</option> <option value="1" [#if followUpRecord.isCloseNiche == 1] selected [/#if]>否</option> <option value="2" [#if followUpRecord.isCloseNiche == 2] selected [/#if]>是</option> </select> </td> </tr> <tr> <th> ${message("项目进度详细描述")}: </th> <td colspan=" 10" style="width: 95%"> <textarea name="projectScheduleDescription" class="text projectScheduleDescription" cols="30" rows="2"/>${followUpRecord.projectScheduleDescription}</textarea> </td> </tr> <tr> <th> ${message("项目运作思路及关键点")}: </th> <td colspan="10" style="width: 95%"> <textarea name="ideaPoint" class="text ideaPoint" cols="30" rows="2"/>${followUpRecord.ideaPoint}</textarea> </td> </tr> <tr> <th> ${message("下一步工作计划")}: </th> <td colspan="10" style="width: 95%"> <textarea name="nextPlan" class="text nextPlan" cols="15" rows="2"/>${followUpRecord.nextPlan} </textarea> </td> </tr> <tr> <th> ${message("需公司其他部门支撑事项")}: </th> <td colspan="10" style="width: 95%"> <textarea name="needBackup" class="text needBackup" cols="15" rows="2"/>${followUpRecord.needBackup}</textarea> </td> </tr> <tr> <th> <span class="requiredField">*</span>${message("总结")}: </th> <td colspan="10" style="width: 95%"> <textarea cols="20" rows="2" name="sumUp" class="text sumUp" required/>${followUpRecord.sumUp} </textarea> </td> </tr> <tr style="display: none" class="t_closeResult"> <th> <span class="requiredField" >*</span>${message("商机关闭原因")}: </th> <td colspan=" 10" style="width: 95%"> <textarea name="closeResult" class="text closeResult" cols="30" rows="2" [#if followUpRecord.isCloseNiche == 2] required [/#if]/>${followUpRecord.closeResult}</textarea> </td> </tr> <tr> <th>${message("图片")}</th> <td colspan="10" style="width: 95%"> <div class="box-wrap"> <div class="box-main" style="overflow:visible;"> <div class="upload-list tc" style="overflow:initial;width:260px;"> [#list followUpRecord.images as image] <div class="ul-box" style="padding:13px 0px 0px"> <div class="pic" style="margin-left:65px; width:80px"><a href="${image.source}" target="_blank"><img src="${image.thumbnail}"></a></div> <b> </b> <a class="del delProductImage1" href="#"></a> <input type="hidden" name="images[${image_index}].title" value="${image.title}"> <input type="hidden" name="images[${image_index}].source" value="${image.source}"> <input type="hidden" name="images[${image_index}].large" value="${image.large}"> <input type="hidden" name="images[${image_index}].medium" value="${image.medium}"> <input type="hidden" name="images[${image_index}].thumbnail" value="${image.thumbnail}"> </div> [/#list] <a href="javascript:;" class="a-upload" id="addProductImage"></a> </div> </div> </div> </td> </tr> </table> <div> <table> <tr> <th>111</th> <td> <textarea rows="2" cols="30"></textarea> </td> </tr> </table> </div> <div class="task-content"> [#include "/crm/follow_up_record/edit/task-form.ftl" /] </div> <br/> <div class="title-style"> 附件上传: <div class="btns"> <a href="javascript:;" id="addAttach" class="button">添加附件</a> </div> </div> <table id="table-attach"></table> <div class="title-style"> 抄送人: <div class="btns"> <a href="javascript:;" id="addMember" class="button">添加抄送人</a> </div> </div> <table id="table-addMember"></table> <div class="title-style"> 定位:提示:你可以放大地图以便更准确标记。 </div> <div> <table class="input tabContent"> <tr> <td colspan="4" style="line-height: 25px;padding: 5px;border-bottom: 1px solid #dde9f5;"> <!-- <span class="fieldSet"> <input type="hidden" id="areaId" name="areaId" /> </span>   详细地址:<input type="text" name="address" class="txt" maxlength="200"/> --> <br/> 定位地址:<input type="text" id="searchText" style="line-height: 20px;width: 400px;border: solid 1px #dcdcdc;"/> <input type="button" value="搜索" id="searchButton" style="border: revert;"/>    详细地址:<input type="text" id="address" name="address" readonly="readonly" value="${followUpRecord.address}" style="line-height: 20px;width: 400px;border: solid 1px #dcdcdc;"/> 经度:<input type="text" name="longitude" id="mapy" readonly="readonly" value="${followUpRecord.longitude}" style="line-height: 20px;border: solid 1px #dcdcdc;"/>   纬度:<input type="text" name="latitude" id="mapx" readonly="readonly" value="${followUpRecord.latitude}" style="line-height: 20px;border: solid 1px #dcdcdc;"/> </td> </tr> <tr> <td style="height:400px;display:block;" colspan="3"> <div id="allmap"></div> </td> <td style="height:400px;"> <ul id="searchResUl"> </ul> </td> <tr> </table> </div> </div> <div class="fixed-top"> [#if followUpRecord.recordStatus == 1] [#if followUpRecord.isCloseNiche != 2] <a href="javascript:void(0);" class="button sureButton" onclick="submitData(this)">${message("提交")}</a> [/#if] <a href="javascript:void(0);" class="button sureButton" onclick="save(this)">${message("保存")}</a> [#if followUpRecord.isCloseNiche == 2 && followUpRecord.wfState == 0] <a href="javascript:void(0);" class="button sureButton" onclick="check_wf(this)">${message("12501")}</a> [/#if] [/#if] <input type="button" onclick="location.reload(true);" class="button resetButton ml15" value="${message("重置")}"> </div> </form>修改该代码 使得文本框能使用回车换行并出现滚动条
07-31
标题基于Python的自主学习系统后端设计与实现AI更换标题第1章引言介绍自主学习系统的研究背景、意义、现状以及本文的研究方法和创新点。1.1研究背景与意义阐述自主学习系统在教育技术领域的重要性和应用价值。1.2国内外研究现状分析国内外在自主学习系统后端技术方面的研究进展。1.3研究方法与创新点概述本文采用Python技术栈的设计方法和系统创新点。第2章相关理论与技术总结自主学习系统后端开发的相关理论和技术基础。2.1自主学习系统理论阐述自主学习系统的定义、特征和理论基础。2.2Python后端技术栈介绍DjangoFlask等Python后端框架及其适用场景。2.3数据库技术讨论关系型和非关系型数据库在系统中的应用方案。第3章系统设计与实现详细介绍自主学习系统后端的设计方案和实现过程。3.1系统架构设计提出基于微服务的系统架构设计方案。3.2核心模块设计详细说明用户管理、学习资源管理、进度跟踪等核心模块设计。3.3关键技术实现阐述个性化推荐算法、学习行为分析等关键技术的实现。第4章系统测试与评估对系统进行功能测试和性能评估。4.1测试环境与方法介绍测试环境配置和采用的测试方法。4.2功能测试结果展示各功能模块的测试结果和问题修复情况。4.3性能评估分析分析系统在高并发等场景下的性能表现。第5章结论与展望总结研究成果并提出未来改进方向。5.1研究结论概括系统设计的主要成果和技术创新。5.2未来展望指出系统局限性并提出后续优化方向。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值