Posts Tagged “IE”

I’ve seen in within my two years of JS progamming some weird things, about browser behaviour. But the one I’ve discovered yesterday tops them all. Some JS class uses in the Init function the document.createElement function. The Script is working fine built in within one Website even with IE. But when the Script is added to another Website, IE complaints that document.createElement isn’t supported by this Object. An alert directly before the call is executed shows:
function createElement() {
[native Code]

But it still doesn’t work in IE.
Someone ever encountered that problem? I’m currently missing a solutin except the try to manually create the HTML-Node.

Tags: none

Tags: document.createElement, IE, Js

Comments 2 Comments »

Since awhile now I’m working with Javascript. I have to say that it’s for sure not that hard to write cross-browser Source Code like it’s still with CSS. But some parts aren’t easy to get them working. A recent problem is indeed the image.onload. At first it’s obviously that you should register an onload EventListener, before you assign an Image, like this:

image.onload = function() { alert("let's do something in here!");};
image.src = "myURL";

As it’s quite possible that the other way around, the picture is already loaded before the EventListener is registered.
But Hey! That’s no reason to make this mistake a few times…Now after you solve that self-made problem you can run into the next one! Opera calls the onload Event, only if the Object is newly created or the Image loaded isn’t already cached. That’s the state of Opera 7.5, as I read several times on various sites, that this problem was fixed within Opera 8.x. But now it seems that this Problem is back with Opera 9.26+( or earlier…).
Unfortunately my Script needs to be noticed everytime a new Image is loaded, although it may already be cached. The only way I’m aware of getting what I want is to disable the Cache of Opera, through Opera’s settings or per HTTP Header. Ok another way would be a function which looks the whole time if the image is changing, but both aren’t that what I’m searching for. Someone know if it’s possible to get some real onload for Images, in Opera, without any of the previously mentioned “hacks”?
Or can Opera fix this problem? It’s working correctly in IE, why not in Opera?

Tags: none
Tags: IE, Javascript, opera, problem

Comments 2 Comments »

Bad Behavior has blocked 1250 access attempts in the last 7 days.