Placing an image with an href in a toolbar cause problem with IE.
I have toolbar which is the topmenu of an extjs application. At the far left of the toolbar, I 开发者_开发问答want to place the company logo, and when users click on the logo, I want them to be directed to the home page. So I have this code for my toolbar:
topMenuToolbar.add({
xtype: 'box',
html: '<a href="'http://www.mysite.com" <img src="/images/mysitelogo.jpg" /></a>'
});
Everything is working perfectly in FF and Safari, but in IE 7 and 8 it's a different story. Look what IE is doing with the code:
<a href="http://www.mysite.com" src="/images/mysitelogo.jpg" <img=""/>
What can I do to resolve that issue?
Well...when the HTML inside the HTML tag is well formed, everything is working perfectly! Instead of :
html: '<a href="'http://www.mysite.com" <img src="/images/mysitelogo.jpg" /></a>'
I did that :
html: '<a href="'http://www.mysite.com"> <img src="/images/mysitelogo.jpg" /></a>'
And now it's working perfect in IE and FF.
精彩评论