[英]Click on button doesn't work in IE9 but no error message (it works in chrome)
I want to try this applet. 我想试试这个小程序。
when clicking on button continue in IE
it doesn't work whereas in chrome
it does. 当单击按钮继续在
IE
中无法使用,而在chrome
则可以。
Why? 为什么? There's no error message.
没有错误信息。
In your JavaScript console (in IE9), you are getting an error. 在您的JavaScript控制台(在IE9中)中,出现错误。
Object doesn't support property or method 'trim'
对象不支持属性或方法“修剪”
IE < 9 doesn't support String.prototype.trim
. IE <9不支持
String.prototype.trim
。 You page is running in "Quirks mode" which means it's running like it's in an old version of IE. 您的页面以“ Quirks模式”运行,这意味着它的运行方式与旧版本的IE相同。
Try to force IE to run the page in the correct mode by adding this to the <head>
: 尝试通过将IE添加到
<head>
来强制IE以正确的模式运行页面:
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
You should also add a doctype to your page. 您还应该在页面上添加一个文档类型 。 Here's the HTML5 one (put this at the top of the page (before
<html>
): 这是HTML5(将其放在页面顶部(在
<html>
之前):
<!DOCTYPE html>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.