Forum Moderators: open

Message Too Old, No Replies

getting properties of dynamically created content

         

noyearzero

8:02 pm on Sep 29, 2008 (gmt 0)

10+ Year Member



i've used javascript to dynamically create an image in a document. now i want to grab the .fileSize from that image. doing a regular call doesn't work, however if i do an alert('anything') before i grab the fileSize it will work. its like it has to refresh to registered nodes? is there maybe a way to do this without using a tacky alert()?

i used replaceChild to create the image if that makes a difference.

Demaestro

8:07 pm on Sep 29, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



This is really hacky but it forcing a refresh of the inner html might do it.

document.getElementById('THE_ID').innerHTML = document.getElementById('THE_ID').innerHTML

grallis

3:38 am on Sep 30, 2008 (gmt 0)

10+ Year Member



Did you dynamically create the image, or dynamically load it in? If it's dynamically created, is there any possibility of creating the image in php or asp? If the image already exists, you can use php or asp to get the filesize ... from what I remember, fileSize isnt available to javascript from Firefox.