开发者

Placing an image with an href in a toolbar cause problem with IE.

开发者 https://www.devze.com 2023-02-10 05:55 出处:网络
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 directe

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号