Flash Games
 FAQ   Search   Memberlist   Usergroups   Register  Profile   Log in to check your private messages   Log in 


check if object created?



 

Post new topic   Reply to topic  
   DEVPPL Forum Index -> JavaScript Forum
View previous topic :: View next topic  
Author Message
vurentjie



Joined: 25 May 2008
Posts: 6

PostPosted: Thu Jun 26, 2008 11:32 am    Post subject: check if object created? Reply with quote

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')){}
Back to top
View user's profile Send private message
rangana
500+ Club


Joined: 27 Feb 2008
Posts: 629
Location: Cebu City Philippines

PostPosted: Fri Jun 27, 2008 4:04 am    Post subject: Re: check if object created? Reply with quote

Code:
if(document.getElementById('mmm'))
alert('Element mmm already loaded')
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    DEVPPL Forum Index -> JavaScript Forum All times are GMT + 1 Hour
Page 1 of 1

 
 
Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums.
Click here to Register

If you are a current member here on DEVPPL, please login below:

User: Pass:
Log me on automatically each visit:

 


Powered by phpBB © 2001, 2005 phpBB Group - Modified by DEVPPL

Flash Games - Sitemap