Jump to content

document.getElementById


Obi1-Cannabis

Recommended Posts

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...