It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

check if object created?

check if object created?

Postby vurentjie on Thu Jun 26, 2008 10:32 am

hi,

i am having a bit of a problem with a call to setInterval on a page,

it seems to be because of the mysql queries run,

if i just run a regular query that calls the data from tables, the script works fine,
but if i first save data then request it after it has been saved, it seems like the objects don't get created before the setInterval is called, at least this is what i am guessing at,

i have thought of moving some of my mysql updates to another page and then redirecting, but this is not the ideal solution, so i was wondering

if i have say a <input type='hidden' value='dfdf' id='mmm'/>

is there any way i could check if this object exists before declaring

var soso = document.getElementById('mmm').value;

something like
if(!document.getElementById('mmm')){}
vurentjie
 
Posts: 6
Joined: Sun May 25, 2008 5:44 am

Postby rangana on Fri Jun 27, 2008 3:04 am

Code: Select all
if(document.getElementById('mmm'))
alert('Element mmm already loaded')
User avatar
rangana
500+ Club
 
Posts: 935
Joined: Wed Feb 27, 2008 5:14 am
Location: Cebu City Philippines


Who is online

Users browsing this forum: No registered users and 6 guests