Tuesday, October 12, 2010

ExtJS 3.0 nonsecure content warning for IE

In Ext-JS 3.0 release, there is a piece of code that will set the default blank image to be http://extjs.com/s.gif if browser is IE6,7 or Adobe Air enabled. The s.gif file is contained in the release package (images/default/s.gif), so I don't know why sencha team still hard coding the URL.

BLANK_IMAGE_URL : Ext.isIE6 || Ext.isIE7 || Ext.isAir ? 'http:/' + '/www.extjs.com/s.gif' : 'data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==',

This will cause some problems. For example, if user using IE and is disconnected or working in LAN who has no access to extjs.com (which will be sencha.com now), UI component such as Combo Box will be rendered incorrectly.
Also, if the website is secured website which uses https connection, visitors will get 'This Page Contains Both Secure and Non-Secure Items' Error Message.
To solve this, code must be changed on the server side because it is caused by URL hard-coded in ext-js library.
What you need to do is at the beginning of your javascript code, reassign the BLANK_IMAGE_URL variable.
Add the following lines:

if(Ext.isIE6 || Ext.isIE7 || Ext.isAir){ Ext.BLANK_IMAGE_URL = "YOUR-CONTEXT-ROOT/images/default/s.gif"; }

That's it.