XML链接未从导出的HTML文件加载

时间:2018-05-22 15:42:18

标签: javascript html xml

首先,我想声明我不是网络开发人员或程序员。我的代码知识很少。我只是一个技术支持代理,试图为用户解决问题。

问题是我们有一个供应商应用程序,它以XML格式提供一些数据,这些数据在Web应用程序上呈现得很好,但是当导出到HTML文件时,该文件中的链接不起作用。链接应该显示XML数据。

在IE11中,当点击任何链接时,它会显示“无法显示网页”,可能的原因是“此网页上的某些内容或文件需要您尚未安装的程序”。此外,所有XML标记和数据都显示在地址栏中。

在Edge中,它显示“嗯......无法访问此页面”,错误代码为0x80704006。

在Firefox和Chrome中,它似乎尝试打开另一个标签,但很快就会消失。

在Opera中,它只显示一个空白的无标题选项卡

在Macbook上的Safari中,它显示正文中的XML值,但不显示任何标记。

我在我的工作Windows 10笔记本电脑上测试了这个,以及安装之前(IE8)和之后(IE11)更新的全新安装的Windows 7,都具有相同的结果。因此,我不相信它是在我们的图像上配置的任何内容或任何导致问题的推送策略。

我已禁用弹出窗口拦截器,并尝试在安全模式下浏览器无效。

我正在使用的一个用户能够在他的个人Macbook上查看XML输出,但仅限于Firefox,目前他正在使用版本57.0.4。

我查看了代码并花了数小时在互联网上研究这个代码,但鉴于我对这个主题缺乏了解,我发现的大部分内容对我来说都没有多大意义。

以下是一些代码,我认为这些代码与此问题最为相关。代码可能没有任何问题,但是如果有人可以看看并告诉我,那就太棒了。如果更好,我可以提供完整的文件。我只是没有看到上传它的选项。

function urldecode(str) {
return decodeURIComponent((str+'').replace(/\+/g, '%20'));
}

function updateEventMessage(str){
var content = urldecode(str);
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
 var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
 if (ieversion>=9)
  ;//document.write("You're using IE9 or above")
 else if (ieversion>=8)
  ;//document.write("You're using IE8 or above")
 else if (ieversion>=7)
  ;//document.write("You're using IE7.x")
 else if (ieversion>=6)
  ;//document.write("You're using IE6.x")
 else if (ieversion>=5)
  ;//document.write("You're using IE5.x")
  var wxml = window.open("","xml");
  wxml.document.open("text/plain");
  wxml.document.write(content);
  wxml.document.close();
}
else{
    //none ie Browser
    window.open("data:text/xml,"+content); 
}    

这是其中一个链接的第一行,显示了XML标记和数据:

<tr><td  rowspan='2' colspan='1' class ='sqd_timestr' width='240' align='right'>2018-05-07&nbsp;09:59:58.371</td><td rowspan='2' width='2'>&nbsp;</td><td  rowspan='2' class ='sqd_rightedge width='2'>&nbsp;</td><td rowspan='2' class=sqd_left-arrow width='2'><img class=sqd_left-arrow src='data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==' width='1' height='1' /></td><td class=sqd_bottomedge width='20'>&nbsp;</td><td class='sqd_bottomedge sqd_msg1' align='center' width='320'><a href='javascript:updateEventMessage("%3CDL-CCCH-Message%3E++%3Cmessage%3E++++%3Cc1%3E++++++%3CrrcConnectionSetup%3E++++++++%3Crrc-TransactionIdentifier%3E0%3C%2Frrc-TransactionIdentifier%3E++++++++%3CcriticalExtensions%3E++++++++++%3Cc1%3E++++++++++++%3CrrcConnectionSetup-r8%3E++++++++++++++%3CradioResourceConfigDedicated%3E++++++++++++++++%3Csrb-ToAddModList%3E++++++++++++++++++%3CSRB-ToAddMod%3E++++++++++++++++++++%3Csrb-Identity%3E1%3C%2Fsrb-Identity%3E++++++++++++++++++++%3Crlc-Config%3E++++++++++++++++++++++%3CexplicitValue%3E++++++++++++++++++++++++%3Cam%3E++++++++++++++++++++++++++%3Cul-AM-RLC%3E++++++++++++++++++++++++++++%3Ct-PollRetransmit%3E++++++++++++++++++++++++++++++%3Cms45%2F%3E++++++++++++++++++++++++++++%3C%2Ft-PollRetransmit%3E++++++++++++++++++++++++++++%3CpollPDU%3E++++++++++++++++++++++++++++++%3CpInfinity%2F%3E++++++++++++++++++++++++++++%3C%2FpollPDU%3E++++++++++++++++++++++++++++%3CpollByte%3E++++++++++++++++++++++++++++++%3CkBinfinity%2F%3E++++++++++++++++++++++++++++%3C%2FpollByte%3E++++++++++++++++++++++++++++%3CmaxRetxThreshold%3E++++++++++++++++++++++++++++++%3Ct32%2F%3E++++++++++++++++++++++++++++%3C%2FmaxRetxThreshold%3E++++++++++++++++++++++++++%3C%2Ful-AM-RLC%3E++++++++++++++++++++++++++%3Cdl-AM-RLC%3E++++++++++++++++++++++++++++%3Ct-Reordering%3E++++++++++++++++++++++++++++++%3Cms35%2F%3E++++++++++++++++++++++++++++%3C%2Ft-Reordering%3E++++++++++++++++++++++++++++%3Ct-StatusProhibit%3E++++++++++++++++++++++++++++++%3Cms0%2F%3E++++++++++++++++++++++++++++%3C%2Ft-StatusProhibit%3E++++++++++++++++++++++++++%3C%2Fdl-AM-RLC%3E++++++++++++++++++++++++%3C%2Fam%3E++++++++++++++++++++++%3C%2FexplicitValue%3E++++++++++++++++++++%3C%2Frlc-Config%3E++++++++++++++++++++%3ClogicalChannelConfig%3E++++++++++++++++++++++%3CdefaultValue%2F%3E++++++++++++++++++++%3C%2FlogicalChannelConfig%3E++++++++++++++++++%3C%2FSRB-ToAddMod%3E++++++++++++++++%3C%2Fsrb-ToAddModList%3E++++++++++++++++%3Cmac-MainConfig%3E++++++++++++++++++%3CexplicitValue%3E++++++++++++++++++++%3Cul-SCH-Config%3E++++++++++++++++++++++%3CmaxHARQ-Tx%3E++++++++++++++++++++++++%3Cn4%2F%3E++++++++++++++++++++++%3C%2FmaxHARQ-Tx%3E++++++++++++++++++++++%3CperiodicBSR-Timer%3E++++++++++++++++++++++++%3Csf5%2F%3E++++++++++++++++++++++%3C%2FperiodicBSR-Timer%3E++++++++++++++++++++++%3CretxBSR-Timer%3E++++++++++++++++++++++++%3Csf320%2F%3E++++++++++++++++++++++%3C%2FretxBSR-Timer%3E++++++++++++++++++++++%3CttiBundling%3E++++++++++++++++++++++++%3Cfalse%2F%3E++++++++++++++++++++++%3C%2FttiBundling%3E++++++++++++++++++++%3C%2Ful-SCH-Config%3E++++++++++++++++++++%3CtimeAlignmentTimerDedicated%3E++++++++++++++++++++++%3Cinfinity%2F%3E++++++++++++++++++++%3C%2FtimeAlignmentTimerDedicated%3E++++++++++++++++++++%3Cphr-Config%3E++++++++++++++++++++++%3Csetup%3E++++++++++++++++++++++++%3CperiodicPHR-Timer%3E++++++++++++++++++++++++++%3Csf200%2F%3E++++++++++++++++++++++++%3C%2FperiodicPHR-Timer%3E++++++++++++++++++++++++%3CprohibitPHR-Timer%3E++++++++++++++++++++++++++%3Csf200%2F%3E++++++++++++++++++++++++%3C%2FprohibitPHR-Timer%3E++++++++++++++++++++++++%3Cdl-PathlossChange%3E++++++++++++++++++++++++++%3CdB3%2F%3E++++++++++++++++++++++++%3C%2Fdl-PathlossChange%3E++++++++++++++++++++++%3C%2Fsetup%3E++++++++++++++++++++%3C%2Fphr-Config%3E++++++++++++++++++%3C%2FexplicitValue%3E++++++++++++++++%3C%2Fmac-MainConfig%3E++++++++++++++++%3CphysicalConfigDedicated%3E++++++++++++++++++%3Cpdsch-ConfigDedicated%3E++++++++++++++++++++%3Cp-a%3E++++++++++++++++++++++%3CdB0%2F%3E++++++++++++++++++++%3C%2Fp-a%3E++++++++++++++++++%3C%2Fpdsch-ConfigDedicated%3E++++++++++++++++++%3Cpusch-ConfigDedicated%3E++++++++++++++++++++%3CbetaOffset-ACK-Index%3E10%3C%2FbetaOffset-ACK-Index%3E++++++++++++++++++++%3CbetaOffset-RI-Index%3E9%3C%2FbetaOffset-RI-Index%3E++++++++++++++++++++%3CbetaOffset-CQI-Index%3E10%3C%2FbetaOffset-CQI-Index%3E++++++++++++++++++%3C%2Fpusch-ConfigDedicated%3E++++++++++++++++++%3Ccqi-ReportConfig%3E++++++++++++++++++++%3Ccqi-ReportModeAperiodic%3E++++++++++++++++++++++%3Crm30%2F%3E++++++++++++++++++++%3C%2Fcqi-ReportModeAperiodic%3E++++++++++++++++++++%3CnomPDSCH-RS-EPRE-Offset%3E0%3C%2FnomPDSCH-RS-EPRE-Offset%3E++++++++++++++++++++%3Ccqi-ReportPeriodic%3E++++++++++++++++++++++%3Csetup%3E++++++++++++++++++++++++%3Ccqi-PUCCH-ResourceIndex%3E0%3C%2Fcqi-PUCCH-ResourceIndex%3E++++++++++++++++++++++++%3Ccqi-pmi-ConfigIndex%3E133%3C%2Fcqi-pmi-ConfigIndex%3E++++++++++++++++++++++++%3Ccqi-FormatIndicatorPeriodic%3E++++++++++++++++++++++++++%3CwidebandCQI%2F%3E++++++++++++++++++++++++%3C%2Fcqi-FormatIndicatorPeriodic%3E++++++++++++++++++++++++%3Cri-ConfigIndex%3E322%3C%2Fri-ConfigIndex%3E++++++++++++++++++++++++%3CsimultaneousAckNackAndCQI%3E++++++++++++++++++++++++++%3Cfalse%2F%3E++++++++++++++++++++++++%3C%2FsimultaneousAckNackAndCQI%3E++++++++++++++++++++++%3C%2Fsetup%3E++++++++++++++++++++%3C%2Fcqi-ReportPeriodic%3E++++++++++++++++++%3C%2Fcqi-ReportConfig%3E++++++++++++++++++%3CantennaInfo%3E++++++++++++++++++++%3CexplicitValue%3E++++++++++++++++++++++%3CtransmissionMode%3E++++++++++++++++++++++++%3Ctm3%2F%3E++++++++++++++++++++++%3C%2FtransmissionMode%3E++++++++++++++++++++++%3CcodebookSubsetRestriction%3E++++++++++++++++++++++++%3Cn2TxAntenna-tm3%3E11%3C%2Fn2TxAntenna-tm3%3E++++++++++++++++++++++%3C%2FcodebookSubsetRestriction%3E++++++++++++++++++++++%3Cue-TransmitAntennaSelection%3E++++++++++++++++++++++++%3Crelease%2F%3E++++++++++++++++++++++%3C%2Fue-TransmitAntennaSelection%3E++++++++++++++++++++%3C%2FexplicitValue%3E++++++++++++++++++%3C%2FantennaInfo%3E++++++++++++++++++%3CschedulingRequestConfig%3E++++++++++++++++++++%3Csetup%3E++++++++++++++++++++++%3Csr-PUCCH-ResourceIndex%3E0%3C%2Fsr-PUCCH-ResourceIndex%3E++++++++++++++++++++++%3Csr-ConfigIndex%3E13%3C%2Fsr-ConfigIndex%3E++++++++++++++++++++++%3Cdsr-TransMax%3E++++++++++++++++++++++++%3Cn64%2F%3E++++++++++++++++++++++%3C%2Fdsr-TransMax%3E++++++++++++++++++++%3C%2Fsetup%3E++++++++++++++++++%3C%2FschedulingRequestConfig%3E++++++++++++++++%3C%2FphysicalConfigDedicated%3E++++++++++++++%3C%2FradioResourceConfigDedicated%3E++++++++++++%3C%2FrrcConnectionSetup-r8%3E++++++++++%3C%2Fc1%3E++++++++%3C%2FcriticalExtensions%3E++++++%3C%2FrrcConnectionSetup%3E++++%3C%2Fc1%3E++%3C%2Fmessage%3E%3C%2FDL-CCCH-Message%3E")'>RRC_RRC_CONNECTION_SETUP</a></td>

谢谢, 肖恩

1 个答案:

答案 0 :(得分:0)

虽然我无法确定导致此问题的原因,但我确实发现Windows 7中的Firefox ESR 52.1.0中的XML链接打开正常,因此我为用户安装了该链接。出于某些安全原因,我猜测新浏览器中的某些内容会阻止此功能。