VeriSign的JavaScript干扰页面功能

VeriSign Obtrusive JavaScript interfering with page function

本文关键字:功能 干扰 JavaScript VeriSign      更新时间:2023-09-26

我有一个VeriSign脚本,它导致我的网站上的javascript通知说"未定义",而不是显示台面

Verisign代码:

< !--dn = "www.mysite.com";
lang = "en";
tpt = "transparent";
vrsn_style = "WW";
splash_url = "https://trustsealinfo.verisign.com";
seal_url = "https://seal.verisign.com";
u1 = splash_url + "/splash?form_file=fdf/splash.fdf&dn=" + dn + "&lang=" + lang;
u2 = seal_url + "/getseal?at=0&sealid=2&dn=" + dn + "&lang=" + lang;
u3 = seal_url + "/getseal?at=1&sealid=2&dn=" + dn + "&lang=" + lang;
var sopener;
function vrsn_splash() {
    if (sopener && !sopener.closed) {
        sopener.focus();
    } else {
        tbar = "location=yes,status=yes,resizable=yes,scrollbars=yes,width=560,height=500";
        var sw = window.open(u1, 'VRSN_Splash', tbar);
        if (sw) {
            sw.focus();
            sopener = sw;
        }
    }
}
var MM_cVer = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin: 0;
var ver = -1;
var v_ua = navigator.userAgent.toLowerCase();
var re = new RegExp("msie ([0-9]{1,}['.0-9]{0,})");
if (re.exec(v_ua) !== null) {
    ver = parseFloat(RegExp.$1);
}
var v_old_ie = (v_ua.indexOf("msie") != -1);
if (v_old_ie) {
    v_old_ie = ver < 5;
}
function v_mact(e) {
    var s;
    if (document.addEventListener) {
        s = (e.target.name == "seal");
        if (s) {
            vrsn_splash();
            return false;
        }
    } else if (document.captureEvents) {
        var tgt = e.target.toString();
        s = (tgt.indexOf("splash") != -1);
        if (s) {
            vrsn_splash();
            return false;
        }
    }
    return true;
}
function v_mDown(event) {
    if (document.addEventListener) {
        return true;
    }
    event = event || window.event;
    if (event) {
        if (event.button == 1) {
            if (v_old_ie) {
                return true;
            } else {
                vrsn_splash();
                return false;
            }
        } else if (event.button == 2) {
            vrsn_splash();
            return false;
        }
    } else {
        return true;
    }
}
function v_resized() {
    if (pageWidth != innerWidth || pageHeight != innerHeight) {
        self.history.go(0);
    }
}
if (plugin) {
    var words = navigator.plugins["Shockwave Flash"].description.split(" ");
    for (var i = 0; i < words.length;++i) {
        if (isNaN(parseInt(words[i], 10))) {
            continue;
        }
        var MM_pVer = words[i];
    }
    var MM_play = MM_pVer >= MM_cVer;
} else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE") >= 0 && (navigator.appVersion.indexOf("Win") != -1)) {
    document.write('<SCR' + 'IPT LANGUAGE=VBScript'> 'n');
    document.write('on error resume next 'n');
    document.write('MM_play = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_cVer)))'n');
    document.write('</SCR' + 'IPT'> 'n');
}
if (MM_play) {
    document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
    document.write('  codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"');
    document.write(' ID="s_s" WIDTH="100" HEIGHT="72" ALIGN="">');
    document.write(' <PARAM NAME=movie VALUE="' + u3 + '"> <PARAM NAME=loop VALUE=false> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=best> <PARAM NAME=wmode VALUE=' + tpt + '> <PARAM NAME="allowScriptAccess" value="always">');
    document.write(' <EMBED src="' + u3 + '" loop=false menu=false quality=best wmode=' + tpt);
    document.write(' swLiveConnect=FALSE WIDTH="100" HEIGHT="72" NAME="s_s" ALIGN=""');
    document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="https://www.macromedia.com/go/getflashplayer" allowScriptAccess="always">');
    document.write(' </EMBED>');
    document.write(' </OBJECT>');
} else {
    document.write("<a HREF='"javascript:vrsn_splash()'" tabindex='"-1'"><IMG NAME='"seal'" BORDER='"true'" SRC='"" + u2 + "'" oncontextmenu='"return false;'" alt='"Click to Verify - This site has chosen a VeriSign SSL Certificate to improve Web site security'"></A>");
    if (document.addEventListener) {
        document.addEventListener('mouseup', v_mact, true);
    } else {
        if (document.layers) {
            document.captureEvents(Event.MOUSEDOWN);
            document.onmousedown = v_mact;
        }
    }
    if (document.layers) {
        pageWidth = innerWidth;
        pageHeight = innerHeight;
        window.onresize = v_resized;
    }
}
if ((v_ua.indexOf("msie") != -1) && (ver >= 7)) {
    var plat = -1;
    var re = new RegExp("windows nt ([0-9]{1,}['.0-9]{0,})");
    if (re.exec(v_ua) !== null) {
        plat = parseFloat(RegExp.$1);
    }
    if ((plat >= 5.1) && (plat != 5.2)) {
        document.write("<div style='display:none'>");
        document.write("<img src='https://extended-validation-ssl.verisign.com/dot_clear.gif'/>");
        document.write("</div>");
    }
}-->

页面代码:

<script type="text/javascript" src="https://seal.verisign.com/getseal?host_name=www.MySite.com&amp;size=S&amp;use_flash=YES&amp;use_transparent=YES&amp;lang=en"> </script>

受影响的Javascript:

RemoveItem: function(itemId)
{
    if(confirm(lang.CartRemoveConfirm)) {
        document.location.href = "cart.php?action=remove&item="+itemId;
    }
},

如果带有lang.CartRemoveConfirm的代码属于您,那么它看起来就像一个带有消息字符串的对象。您应该注意到,VeriSign脚本的第二行将lang重新定义为字符串"en",覆盖了它之前可能具有的任何值。你能用其他变量名吗?

这里也有同样的问题,考虑在使用此lang的页面上使用iframe来密封(CS Cart与Verisign)。