471,853 Members | 1,634 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,853 software developers and data experts.

problem with innerhtml and IE "view source" - need help please

I found a problem with my application when using "innerhtml" to
replace the content from the server after making an ajax call. The
display is perfectly correct, but when I use "view source" on the
browser, I found the "source" is still the old content the same as
before I replaced them with the "innerhtml". This causes some problem
with my other dynamic links based on the content of the page as they
pull the old content instead of the new content. I wonder if anyone
knows why and how to resolve it? Any input is appreciated very much.
Thanks in advance, Jane

Sep 10 '07 #1
6 4242
Thanks for the response. Is there anyway I can replace the source with
the current DOM tree?
Add the statement "debugger;" anywhere in your code... that will activate real time debugging and you'll be able to see
whats going on at that spot in the code.

Then... Use Firefox if you can... theres an Addon called Firebug. Get it! Learn how to use it. You'll never forget
the moment which that single addon changed so much in your web programming life.

Sep 10 '07 #2
also, theres an addin for IE called Internet explorer web developer toolbar. It's essentially the same thing for IE
with significantly less functionality, but what it does have will be enough I believe.
Sep 10 '07 #3
Sorry for the confusion. Actually, I don't really care about how the
source look like. What really bothers me is that my dynamic array did
not get to set to the value of the new content, even the array
assignment session is within the "innerhtml" block:

urlArray[x] = Page_B_x.htm;

<a href=urlArray[x]>New Page</a>

-it looks like the html that I rendered from the "innerhtml" has the
correct "urlArray[x] = Page_C_x.htm;" on it:

~~~~~~~~ new content in the memory ~~~~~~~
urlArray[x] = Page_C_x.htm;

<a href=urlArray[x]>New Page</a>

But when I click on the "New Page", it did not pick up the correct
urlArray[x] value which was still staying in the old content of

BTW, out application is only running on IE, for the limitation,
Firefox is not an option.

Any clue? Thanks in advance.

Sep 10 '07 #4
jluo wrote:
urlArray[x] = Page_B_x.htm;

<a href=urlArray[x]>New Page</a>
~~~~~~~~ new content in the memory ~~~~~~~
urlArray[x] = Page_C_x.htm;

<a href=urlArray[x]>New Page</a>
ok... so... I've never seen code like this

<a href=urlArray[x]>

so I'm at a loss unless thats some kind of pseudo-code.

Anyway... Do you have MSOffice Installed? FULLY?

If so you can set up the machine to stop at the


statement and then watch it run inside the MSE7.exe
(which is the Microsoft Script Editor for Office2k3)

You will have access to locals, call stack etc...

Make sure IE is set up to allow debugging ...
Tools - Internet Options - Advanced [tab]
uncheck disable script debugging (both of them)
check display a notification about every script error.
If the debugger statement fails to fire and give you the ability
to watch the code, then uncheck the display notification check,
and try it again after opening a new browser instance.

If you can get the processID of IE then you can attach the
debugger to the running process

C:\Program Files\Common Files\Microsoft Shared\VS7DEBUG>vs7jit -p XXXX

where XXXX is the processID

To check the JIT settings :
C:\Program Files\Common Files\Microsoft Shared\VS7DEBUG>MDM /dumpjit

and some more help from the web...




Sep 11 '07 #5
jluo <ja********@gmail.comwrote:
Page A1 -- new content after using "innerhtml", the same url_dynamic
within the block that content been replaced, should contain: (at least
the response text from the server looks like to contain the correct
content for the urlArray[x])
I don't understand your confused description of what you are doing, but one
question I have: you do realise that Javascript is case sensitive don't

Assiging to an attribute called "innerhtml" will simply create an attribute
of that name, it won't have any other effect.
Sep 11 '07 #6
Thanks all for the help. I found a solution for it. I guess I had
expected too much from the simple "innerhtml". Martin and Duncan gave
me a good hint that this call does not relocate memory for anything.
It only works for presenting the content on the browser but not
"storing" it for further use. Just a snap shot of the content. Really
appreciate for all the inputs! DN, I'll try your way of debugging in
future if anything is really bad. I'm not a javascript developer, so
very out in using any native tools. Thanks again for all the help.
Sep 11 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Phil Powell | last post: by
18 posts views Thread by Lorem Ipsum | last post: by
10 posts views Thread by Wildemar Wildenburger | last post: by
reply views Thread by NeoPa | last post: by
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.