View Full Version : More than one place to change the BLANK_IMAGE_URL
Hi,
I changed the BLANK_IMAGE_URL in Ext.js, but the s.gif is still downloaded from extjs.com.
Therefore, I searched for s.gif and found that it is also defined hard coded in:
1. adapter\jquery\ext-jquery-adapter.js
2. adapter\prototype\ext-prototype-adapter.js
3. adapter\yui\ext-yui-adapter.js
Must I change it hard-coded in all these files?
This is not reasonable since my application is always installed on different servers + I will always need to update them with each ext upgrade!
Please help,
Thanks,
Maya
tryanDLS
21 May 2007, 11:25 AM
You don't need to modify the adapters. Set that variable to your local value at the top of your code when you initialize your app - after the ext js files have been loaded.
maya
27 May 2007, 12:54 AM
But this URL is defined hard-coded in the adapters.
(e.g., in ext-prototype-adapter.js the code is: "BLANK_IMAGE_URL:"http://..." - no var is used.).
wizzud
27 May 2007, 3:46 AM
Use something like this...
<script type='text/javascript'>
Ext.BLANK_IMAGE_URL = 'http://www.yoursite.com/images/s.gif';
Ext.EventManager.onDocumentReady(... , ... , ...);
});
</script>
...then check in Firefox (using Web Developer extension) under Images - View Image Information and see if any image source goes off-site for s.gif (regardless of the adapter).
Thanks for your reply.
What did you mean by adding the code line:
Ext.EventManager.onDocumentReady(... , ... , ...); ?
According to your suggestion, I added the code:
<script type='text/javascript'>
Ext.BLANK_IMAGE_URL = 'http://www.yoursite.com/images/s.gif';
</script>
and it works fine so far. (I don't use firefox, so I didn't make the test you suggested).
Thanks,
Maya
What did you mean by adding the code line:
Ext.EventManager.onDocumentReady(... , ... , ...); ?
It means that you may put the Ext.BLANK_IMAGE_URL line at the top of your JS code, together with other Ext overrides that you may need, and after that would come the application code proper, i.e. the part that must be executed once the document is ready. BTW, Ext.EventManager.onDocumentReady is the same as Ext.onReady.
(I don't use firefox, so I didn't make the test you suggested).
AFAIK, Firefox is the browser that currently offers the best set of development/debugging tools --e.g. Firebug, to name the most notable. Just curious... any reason to not use it?
My application runs on IE6, so testing it in Firefox will not promise that it will run correctly on IE.
But, I agree that the tools offered in Firefox are much better. what are the best tools for IE in your opinion?
Thanks,
Maya
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.