I wanted to make a js script that would take a few classnames from a MySQL DB and select all images with those classnames. I did that with this part (this works): new Ajax.Request( ''/control/media/getClassNames'', { onSuccess: function (r) { r.responseText.evalJSON().each( function( type ) { var imgs = $$( ''img.'' + type ); imgs.each(function(img) { //do some stuff } so the php script returns a list of classnames JSON encoded. Those classnames mean a certain size for the picture, in this example cc_mediapreview, means maxwidth=290px and maxheight=190px. This way I can dynamically define the size of certain classes of pictures. I used url="img_url" instead of src="img_url" to make sure that the browser doesn''t try to load the (original)images at all. Then in the //do some stuff I do this: var url = img.getAttribute(''url''); //Use ajax to see if temp img exists, if it doesn''t exist it will be created on the fly new Ajax.Request( ''/control/media/temp_exists'', { parameters: { file: ''/images/temp'' + url.substring(url.lastIndexOf(''/''),url.lastIndexOf(''.'')) + ''_temp_'' + type + url.substr(url.lastIndexOf(''.'')), org_url: url, class: type }, onSuccess: function (r) { img.src = r.responseText; } } ); Again this works fine, it looks if there is a temp file and otherwise it creates one and echo''s back the the temps path. First this was all I wanted, but what it does is it waits for the body onLoad event to execute it. This isn''t good because all (original)images would have to be loaded first before they would get replaced by the right (temp)images So I used a bit of code from http://www.brothercake.com/site/reso...ipts/domready/ so I could make it do all this before the images were loaded with: var foobar = new domFunction(function () { imagesCCInit(); }, { ''img'' : ''tag''}); imagesCCInit(); is the function that makes a new object var myImagesCC = null; function imagesCCInit() { myImagesCC = new imagesCC(); } This is where it goes wrong in IE, it throws back an error Object Expected on line 9. That is the line with domFunctions. I changed that to var foobar = new domFunction( new Function (''imagesCCInit()''), { ''img'' : ''tag''}); this part doesn''t give an error anymore, it has now gone to the actual imagesCCInit() function where it gives the same error in IE Why does it do this and how can I fix it? If I just use: Code: Event.observe(window, ''load'', imagesCCInit, false); it works for all browsers. so it is only that part of the code. You can check at http://www.clipcontrol.com that it works in both FF and Opera just great. Thanks for any help! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---