I agree this is strange, but can't you just store the result in a global
variable and access the current HTML that way?  You might also try
document.getElementsByTagName('body')[0].innerHTML

On Wed, Nov 9, 2011 at 12:23 AM, Massimo Bove <[email protected]>wrote:

> and i'm already using a timer but the problem is still the same ...
> the script get the default value instead the updated value from ajax
>
> 2011/11/9 Massimo Bove <[email protected]>:
> > is the same...
> > the document don't get the changes made after the onload event....
> >
> >
> > 2011/11/9 Sam L <[email protected]>:
> >> Try using
> >> setTimeout(function(){ alert(document.body.innerHTML); }, 25);
> >>
> >> Possibly if you're in a listener then not everything has caught up yet.
> >> On Tue, Nov 8, 2011 at 3:21 PM, Massimo Bove <[email protected]>
> wrote:
> >>>
> >>> no
> >>> my problem is another
> >>> i have a simple page like:
> >>> <html><body>test</body></html>
> >>>
> >>> if i call document.body.innerHTML is "test"
> >>>
> >>> in that page a js script call with an ajax another page and do
> something
> >>> like
> >>> document.body=response //response = blabla
> >>>
> >>> if now i call again document.body.innerHTML is still "test" and isn't
> >>> blabla...
> >>> what i want is the new value...
> >>>
> >>>
> >>>
> >>>
> >>> 2011/11/8 Sam L <[email protected]>:
> >>> > Have you tried
> >>> > var doc = document;
> >>> > ...{
> >>> >     doc.body
> >>> > {
> >>> >
> >>> > or chances are the document hasn't been modified, if you can visually
> >>> > detect
> >>> > the modification but not detect it programatically then you may be
> >>> > trying to
> >>> > access the changes in an outdated manner, you should probably be
> using
> >>> > document.getElementById() or equivalent.
> >>> > On Tue, Nov 8, 2011 at 1:25 PM, Trigun <[email protected]>
> wrote:
> >>> >>
> >>> >> hello
> >>> >> i'm making a js script with greasemonkey... in that script i put
> this
> >>> >> line
> >>> >>
> >>> >> document.addEventListener ("DOMSubtreeModified", check, false);
> >>> >>
> >>> >> in the check function i use the document var but it always point on
> >>> >> the document loaded and i lost the change maded by the ajax...
> >>> >>
> >>> >> how i can update the document var every time the document is
> modified?
> >>> >>
> >>> >> tnx
> >>> >>
> >>> >> --
> >>> >> You received this message because you are subscribed to the Google
> >>> >> Groups
> >>> >> "greasemonkey-users" group.
> >>> >> To post to this group, send email to
> >>> >> [email protected].
> >>> >> To unsubscribe from this group, send email to
> >>> >> [email protected].
> >>> >> For more options, visit this group at
> >>> >> http://groups.google.com/group/greasemonkey-users?hl=en.
> >>> >>
> >>> >
> >>> > --
> >>> > You received this message because you are subscribed to the Google
> >>> > Groups
> >>> > "greasemonkey-users" group.
> >>> > To post to this group, send email to
> >>> > [email protected].
> >>> > To unsubscribe from this group, send email to
> >>> > [email protected].
> >>> > For more options, visit this group at
> >>> > http://groups.google.com/group/greasemonkey-users?hl=en.
> >>> >
> >>>
> >>>
> >>>
> >>> --
> >>> Massimo Bove.
> >>>
> >>> --
> >>> You received this message because you are subscribed to the Google
> Groups
> >>> "greasemonkey-users" group.
> >>> To post to this group, send email to
> [email protected].
> >>> To unsubscribe from this group, send email to
> >>> [email protected].
> >>> For more options, visit this group at
> >>> http://groups.google.com/group/greasemonkey-users?hl=en.
> >>>
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups
> >> "greasemonkey-users" group.
> >> To post to this group, send email to
> [email protected].
> >> To unsubscribe from this group, send email to
> >> [email protected].
> >> For more options, visit this group at
> >> http://groups.google.com/group/greasemonkey-users?hl=en.
> >>
> >
> >
> >
> > --
> > Massimo Bove.
> >
>
>
>
> --
> Massimo Bove.
>
> --
> You received this message because you are subscribed to the Google Groups
> "greasemonkey-users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/greasemonkey-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/greasemonkey-users?hl=en.

Reply via email to