PDA

View Full Version : [CLOSED][3.??] Bug with messageBox in IE7&8



sunxiang0918
8 Jul 2009, 11:04 PM
Hello
Today,I used the codes like this:


<html>
<head>
<link href="js/lib/extjs/resources/css/ext-all.css" type="text/css" rel="stylesheet">
<script src="js/lib/extjs/adapter/ext/ext-base-debug.js" type="text/javascript">
<script src="js/lib/extjs/ext-all-debug.js" type="text/javascript">
<script type="text/javascript" >
Ext.onReady(function({
Ext.get('button1').on('click',function(e){
Ext.MessageBox.alert('clicked', 'be clicked');
});
}));
</script>
</head>

<body>
This is My index.html
<br/>
<button id="button1">button1</button>
</body>
</html>
the messageBox will like this in IE:
http://i3.6.cn/cvbnm/73/83/82/06377c557d58bb7e5cc4e7831e761bb3.jpg

But,when I edited the code like it:


<body>
<button id="button1">button1</button>
This is My index.html
<br/>
</body>
the page is in working order.

mystix
8 Jul 2009, 11:07 PM
your screenshot is missing.

Condor
8 Jul 2009, 11:10 PM
Isn't this the 'IE can't handle the first node being a textnode bug'?

Try if this helps:

<body><span></span>
This is My index.html
<br/>
<button id="button1">button1</button>
</body>

mystix
8 Jul 2009, 11:13 PM
probably.
i think we can even get away with html comments:


<body><!-- death to IE! -->
This is My index.html
<br/>
<button id="button1">button1</button>
</body>

evant
8 Jul 2009, 11:17 PM
Yup, this is the "text node first bug". As the others have suggested, there's several ways to work around it. Going to mark this as closed.