I use ajax to display number of hits being made on a page, in the first time of loading, the number is retrieved from the DB, in the rest time, I want to get it from another page directly that knows a new hit is being made.

I don't know how to let that page to change the innerHTML in a different page. Normally we do: document.getElementById("someID"); but it is for the current page, what would be the code that specify which page's text field ID to go?

thanks.

    Im not sure i understand please explain a little bit more are you trying to retrieve a value from a previous page ?

      Maybe my first paragraph is unnecessary.

      I want to retrieve or set value of innerHTML in another page. How could we do that? This might just be a javascript question.

        ajax.request.responseText?

          ajax.request.responseText?

          What the? Where is this ajax object coming from?

          Maybe you should take a look at the [man]DOM[/man] objects. In particular domdocument->getelementbyid().

            thorpe wrote:

            What the? Where is this ajax object coming from?

            Maybe you should take a look at the [man]DOM[/man] objects. In particular domdocument->getelementbyid().

            Ajax object could be like this ...

            function Ajax()
            {
                this.request = (window.XMLHttpRequest)? new XMLHttpRequest(): new ActiveXObject("MSXML2.XMLHTTP");
            }
            var ajax = new Ajax();
            

            but I didnt enter into a more detailed explination because I understand that he use ajax and he want to change a part of he's html page (innerHTML) with something that a different page returned, if I am wrong then I'm sorry, from he's question I didnt understand like u did, that he want to find out the element that have a certain ID [document.getElementByID('the_id')]
            When I first read he's post I didnt see that part about getElementByID maybe he edited later, or I wasnt carefull when I read/answer...

              thanks guys for ur discussion. But I still would like to know if there is solution to change value of text field in another page...

                Write a Reply...