123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|597|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Web Development -> Javascript question

Sat, 10 Feb 2007, 14:44
mike_g
I have an HTML page with a little javascript prog that runs in it. If I have a variable printed on screen that changes, can i get that change to be displayed on-screen without having to refresh the page?

I can do this with form input boxes. IE:

could change the text in a input field to 10, and this would be displayed in the field once that is done. Hope this makes sense.
Sun, 11 Feb 2007, 00:24
shroom_monk
Well, in JavaScript, you can use it tot change the values of any parts of an object in the HTML. So, if you put the text inside an object, you could change it with the JavaScript without having to refresh the page. Although I can't think of any objects that would work off the top of my head...

-=-=-
A mushroom a day keeps the doctor away...

Keep It Simple, Shroom!
Sun, 11 Feb 2007, 07:43
TheMadProff
It should work with text areas, text boxes and probably a few others...

-=-=-
''It works, but I'm not sure why it works...''
Sun, 11 Feb 2007, 07:54
mike_g
Yeah i know it works with text boxes, but I wanted to find out if you can do it to normal text, as in not in a box.

Calling the time updates text displaying the time every second, so i figured there might be a way to update other text.
Sun, 11 Feb 2007, 08:50
HoboBen
Is this anything like what you want?



Example Page

-=-=-
blog | work | code | more code
Sun, 11 Feb 2007, 11:12
mike_g
Cool, that looks like what I want. The text I'm using will be a variable that will change frequently, but from what I have seen I don't think that will be a problem. Now I'll just have to try it out, cheers