The page shows the actual .href (you can not click on it though), but the onMouseOver and onMouseOut attributes are lost, and no new picture will appear (offsetted by X-Y coordonates)
It's somewhat confusing to describe this - but I figure that I made things at least a little clear. Does anybody have any idea how to fix this, and to make it work?
I want to make that element so I can modify the below code
t[t.length] = ["a_name","<a onmouseover='showImg(this,'http://picture.jpg')' onmouseout='hideImg()'><img src='http://thingy.gif' alt=''></a>"]
t[t.length] = ["a_name",n]
But neither having the above code in that huge t[t.lenth] form won't make it work,
1-st it gives a syntax error - i figure its because of the onmouseout attribute that has to declare itself using single quotes and to declare the img src with single quotes, so using in two instances single quotes,
2nd - it can not find the showImg function if I onMouseOver the pic
var b = document.createElement('br');
var n = document.createElement('a');
var i = document.createElement('img');
i.src = "http://thingy.gif";
i.alt = "";
n.href = "http://127.0.0.1";
t[t.length] = n;
I read somewhere that if you create a new element, give attributes to it and then append it to the document, the attributes won't be initiated. (which is pretty much my problem here.)
I also read there that if you want to have those attributes to the element that you appended to the document, all you had to do is to re-initialize it, or something, as I unfortunately forgot the page talking about it, and I briefly remember the discussion.
Anyone know how I can re-initialize that n variable?
something like n = new n, if it exist..