WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 dynamics objects, Flavio, April 2, 2004
     Re:dynamics objects, Mikael, April 2, 2004
         Re:dynamics objects, Flavio, April 3, 2004
             Re:dynamics objects, Erik Arvidsson, April 3, 2004
                 Re:dynamics objects, Flavio, April 3, 2004
                     Re:dynamics objects, Erik Arvidsson, April 7, 2004
                         Re:dynamics objects, Flavio, April 17, 2004
                             Re:dynamics objects, Erik Arvidsson, April 18, 2004
                                 Re:dynamics objects, Flavio, April 18, 2004
                                     Re:dynamics objects, Erik Arvidsson, April 22, 2004
                                         Re:dynamics objects, Flavio, April 23, 2004
                         Re:dynamics objects, Mikael, April 9, 2004
                     Re:dynamics objects, Mikael, April 7, 2004

Subject: Re:dynamics objects From: Flavio Date: April 3, 2004
People

After creating the element, ive inserted it into the document and after this insert ive make the event, then its run...
function t1() { alert("running"); }
function teste() {xyz = document.createElement("table"); document.getElementsByTagName("body").item(0).appendChild(xyz);
xyz.addEventListener("mousemove",t1,false);}

but just in mozilla browser!!!
for ie ive made some modifications that make the global event goes ok, but not the event on the new object...
function t1() { alert("running"); }
function teste() {xyz = document.createElement("table"); document.getElementsByTagName("body").item(0).appendChild(xyz); document.innerHTML+=""; document.attachEvent("onmousemove",t1);}
it run, but if modified to the new object it not run...
function t1() { alert("running"); }
function teste() {xyz = document.createElement("table"); document.getElementsByTagName("body").item(0).appendChild(xyz); document.innerHTML+=""; xyz.attachEvent("onmousemove",t1);}

thanx in advance





This looks fine. You need to insert the table into the document (and you need to add tbody, trs and tds to it as well). When it is inserted and you click on it it will show your alert.

erik


yes, the last code is that im trying to use...
test() and t1()
thanx...

From: Mikael
Sent: April 2, 2004
Subject: Re:dynamics objects

test()..teste() is that the same function?


From: Flavio
Sent: April 2, 2004
Subject: Re:dynamics objects

People
im created a js file with some functions, and one of this functions create a table object as below:
function test(){ xyz = document.createElement("table"); }
Until here all ok. But now im trying to make the events to this table to run, but i cant... anyone could help me???
function t1() { alert("running"); }
function teste() {xyz = document.createElement("table"); xyz.onclick=t1;}
Why its not running????
thanx in advance











Reply
Name: 
Email: 
Subject: 

Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.


View All Messages
Back to WebFX