Safari中不支持编码

编程入门 行业动态 更新时间:2024-10-12 16:29:22
本文介绍了Safari中不支持编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

以下编码在IE中运行良好。我还需要在Safari中使用此代码。

The below coding works well in IE. I also need to work this code in safari.

function Transmit_SOAP() { if(window.ActiveXObject) {//For IE Browsers. This coding works well in IE browsers var tempNode=xmlSoapTemplate.selectSingleNode(pathString+"xmlDatasets"); tempNode.appendChild(xmlDataReturn.documentElement); } else {//verify the code below.(Safari Support) alert("Checking"); try{ var tempNode=xmlSoapTemplate.evaluate(pathString+"xmlDatasets", xmlSoapTemplate, null, XPathResult.ANY_TYPE,null); } catch (e) { alert(e); } tempNode.appendChild(xmlDataReturn.documentElement); } }

请核实旅行代码。显示警报后代码执行中断(正在检查); 这是使用try catch时的错误 TypeError:未定义值(表达式xmlSoapTemplate.evaluate的结果)不是对象 下面的代码是xmlSoapTemplate

Kindly verify the safari code. The code execution breaks after showing the alert("Checking"); This is the error when using try catch TypeError: Value undefined (result of expression xmlSoapTemplate.evaluate) is not object The below code is xmlSoapTemplate

if(window.ActiveXObject) { //For IE Support. //Begin by loading up the dataform via soap request xmlSoapTemplate=new ActiveXObject("Microsoft.XMLDOM"); xmlSoapTemplate.onreadystatechange = function () { if (xmlSoapTemplate.readyState == 4) Transmit_SOAP() }; xmlSoapTemplate.load("../Dataforms/soap_1.xml"); } // For Safari Support else { xmlSoapTemplate = new XMLHttpRequest(); xmlSoapTemplate.open('GET','../Dataforms/soap_1.xml', true); xmlSoapTemplate.onreadystatechange = function() { if (xmlSoapTemplate.readyState == 4) { Transmit_SOAP() } } xmlSoapTemplate.send(); }

推荐答案

void compatibility() { if (Request.UserAgent.IndexOf("AppleWebKit") > 0) { Request.Browser.Adapters.Clear(); } }

将此代码粘贴到页面加载事件

paste this code on page load event

更多推荐

Safari中不支持编码

本文发布于:2023-10-24 21:01:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1524993.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:中不   Safari

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!