Obi1-Cannabis Posted January 24, 2007 Share Posted January 24, 2007 i have a <div id="ref"> and am trying to do document.getElementById("ref").innerHTML=xmlHttp.responseText, witch is in my .js file, i recieve an error message sayin: Error:'document.getElemtById(...)' is null or not an object.and i can't find out what seems to be the problem . Link to comment Share on other sites More sharing options...
Obi1-Cannabis Posted January 24, 2007 Author Share Posted January 24, 2007 nevermind, the problem wasn't where i was looking for it. but now i have a new problem and this is bigger(i think), what i'm trying to do is using a setTimeout() that every x seconds uses ajax to refresh my page. and i thought it might work using the tag i was asking about before and in my php file i just put <? echo "<META HTTP-EQUIV=Refresh CONTENT=\"0; URL="my.php\">";?> you think it's possible and i'am doing something wrong or it's just not possible?sorry for the previous post and thanks in advance. Link to comment Share on other sites More sharing options...
aspnetguy Posted January 24, 2007 Share Posted January 24, 2007 yes that will work...if you change the CONTENT from 0 to a reasonable number Link to comment Share on other sites More sharing options...
Obi1-Cannabis Posted January 25, 2007 Author Share Posted January 25, 2007 it doesn't refresh if i put it into a <div>, though it refreshes when i give de id='ref' to the <body> ... but the content simply desapears instead of randomise it again...see, i had this working using just the meta tag with no ajax in this, but this specific page of this site is to be used also as some kind of presentation that's allways working on a shop's show window... and so if something happened (like server going down or something) the refresh would simply stop working and this stops working until someone refreshes it manualy, so the idea is to use ajax because script keeps working...but i'm not even sure if the setTimeout() works as i'm thinking. Link to comment Share on other sites More sharing options...
Obi1-Cannabis Posted January 25, 2007 Author Share Posted January 25, 2007 i guess that was a stupid idea, because it still wouldn't respond if server was downso it woulndt refresh.Solved it using: <body onload="setTimeout('location.reload(true)',25000)"> i think that's fine... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now