vbscript在IE10浏览器模式下不起作用 [英] vbscript is not working on IE10 browser mode

查看:247
本文介绍了vbscript在IE10浏览器模式下不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的客户决定升级到Windows 7和IE10.我们在1.1点网框架中的应用程序出现问题,因为它包含vbscript,一旦用户将浏览器模式更改为IE 10,它就无法正常工作.如果将浏览器模式选择为IE 10兼容性视图.在IE9,IE8上也可以正常工作. Vbscript可以很简单,如下所示.

Our client decided to upgrade to windows 7 and IE 10. Our application which is in 1.1 dot net framework is having issues as it contains vbscript which does not work as soon as user changes the browser mode to IE 10. It works fine if the browser mode is selected as IE 10 compatibility view. It also works fine on IE9,IE8. Vbscript can be as simple as below.

<script language="vbscript">
function ValidateEmail(sEmail)
    set myExpression = new RegExp
    myExpression.pattern = "^(\w+\.)*(\w+)@(\w+\.)+([a-zA-Z]{2,4})$"
    If myExpression.test(sEmail.value) = True Then
        msgbox "Valid Email"
    Else
        msgbox "Invalid Email"
    End If
End Function
</script>

我们已经尝试通过在网络配置中添加X-UA-Compatible来以编程方式更改google上的文档模式.

We have already tried changing document mode programmatically as can be found on google by adding X-UA-Compatible in web config .

<system.webServer>
        <httpProtocol> 
            <customHeaders> 
                <clear /> 
                <add name="X-UA-Compatible" value="IE=9" / > 
            </customHeaders> 
        </httpProtocol>
</system.webServer>

尽管以上代码无法用作标签system.webServer不适用于1.1点网框架.我们还尝试通过添加自定义部分来更改计算机配置,但没有成功. :(

Though above code does not work as tag system.webServer does not work for 1.1 dot net framework. We also tried changing the machine config by adding a custom section.Though no success. :(

能否请您提供一种解决方案,使vbscript可以在IE 10浏览器和IE 10兼容视图两种浏览器模式下在IE 10浏览器上工作? 预先感谢.

Can you please provide us a solution by which vbscript can work on IE 10 browser for both browser modes IE 10 as well as IE 10 compatibility view? Thanks in advance.

推荐答案

如果无法使http标头起作用,则可以使用元标记:

If you're unable to make an http header work, you can use a metatag:

<meta http-equiv="x-ua-compatible" content="IE=9">

将其尽可能靠近<head>的顶部放置,最好放在<title>元素之前,例如

Place it as close to the top of the <head> as possible, ideally before the <title> element, e.g.

<html>
    <head>
        <meta http-equiv="x-ua-compatible" content="IE=9">
        <title>My webpage</title>
    </head>
    <body>
        <p>Content goes here.</p>
    </body>
</html>

http://上有更多信息msdn.microsoft.com/en-gb/library/jj676915%28v=vs.85%29.aspx

这篇关于vbscript在IE10浏览器模式下不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆