469,277 Members | 2,181 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,277 developers. It's quick & easy.

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 4154
dn
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.

D.
Sep 10 '07 #2
dn
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.
http://www.microsoft.com/downloads/d...displaylang=en
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
"Page_B_x.htm".

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
dn
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

debugger;

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...

http://www.ajaxhead.com/javascript/d...avascript.html

hth,

D.

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
you?

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
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.