Skip to main content
Inspiring
January 9, 2008
Question

How can I view what gets added by AJAX?

  • January 9, 2008
  • 5 replies
  • 476 views
Hello. I'm making heavy use of the innerHTML = capacities of the Document Object Model, and of the new AJAX abilities available in CF8. But when my code has a bug, the error messages provided by Internet Explorer are cryptic. That might be something one could live with if only we knew what line the error occurs on. But clicking 'View Source' and loading the result into a text editor which tells you line numbers doesn't work for material added by innerHTML = or by AJAX. All it shows you is your original page before the material got added.

What to do?

Thanks for your help,
Peyton Todd

P.S. I know that Firefox provides much better information about errors, and on occasion this has been useful to me. But Firefox (a) doesn't recognize all the DOM functions I want to use; (b) has its own ideas about what the display should look like, messing up my crowded page; and (c) doesn't even recognize my use of AJAX , which works fine in Internet Explorer. I don't need to make these pages work in Firefox (and my client wouldn't pay for it) since this is in effect an INTRAnet, where the users will all be employees of the company although not physically located in its offices when the use this intranet.
This topic has been closed for replies.

5 replies

PeytonTAuthor
Inspiring
January 11, 2008
Just to clarify: The work 'Howe' at the bottom of my note just above is a typographical error, perhaps left over from a question I was asking, e.g., 'How ...'. Sorry.
PeytonTAuthor
Inspiring
January 11, 2008
Thanks for your suggestions. Just to start with IE, since what I have to say is shorter: I installed the Web Developer toolbar, and will be exploring it, but I decided to hold off on Fiddler for now, unless I think I'll need to delve into its many complexities.

For Firefox, I've done all the things you suggested except the Coldfire one: there, after I downloaded it tried to unzip it, I was asked what directory to put it on, and I thought it best to ask your advice. Should I put it on my web root? Does it matter? (My guess is it doesn't matter, but it doesn't hurt to ask.) Its default is install it on a location buried deep within My Documents.

With all those things installed (except Coldfire so far), I'm getting strange behavior in Foxfire. First, although some of my simple web pages work there, the big, complicated one does not (in addition to the many differences in formatting). Also, unlike my earlier experience with Firebug, I am not being told of errors right away. Instead, no errors appear until you click on 'debug', or on 'dockable window'. In the dockable window, it claims there are no exceptions, so that looks like it didn't find the errors which must be occurring. However, if you ask for the floating window, it does mention an error, but it is mistaken. It claims that the only parm which I'm passing to the page in the url, ?jn=12800 (for 'job number') is not there (hence that an attempt to set that to a Session variable fails), when in fact it WAS passed to the page. Or at least my code in the referring page passed it there. If you look in the location bar, you find that it still has the page address of the referring page, with my url as a parm, and yes, it has removed the ?jn=12800 that I had included.

Another great disappointment: one thing I was particularly interested in was seeing the source code that gets built, both by setting innerHTML and by AJAX. But the menu choices to View Source, including particularly the ones to View Generated Source (which seemed so promising) turn out to refer only to THEIR source, not the source of my page.

What next?

Howe
Inspiring
January 10, 2008
1) it is Firefox, not Foxfire
2) you should also have installed an FF extension called Firebug - it is
a debugging add-on
2.1) also install the Web Developer Toolbar extension
3) also install ColdFire - a special add-on for Firebug which displays
specific CF debugging info
4) turn in and use the AJAX debugger in CF8

on IE (i pity you using it for dev work) make sure you have installed:
1) Fidder
2) Web Developer Toolbar

---
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com
PeytonTAuthor
Inspiring
January 9, 2008
Hmmm. That might be feasible for some of the particular DOM features (getElementById is one it seems to always complain about), and for the display issues (things which wrap on one browser and not the other, etc.). But only if AJAX works. And it never does, at least on my complex page. Nor does Foxfire complain. It simply leaves out those sections of the page.

Any ideas on what might be wrong here?

(I'm using 'source=' into a <cflayoutarea>, and ColdFusion.navigate into a <cfdiv>. I use other AJAX functions, too, but Foxfire never gets past these. And at present, at least, it reports no errors.)
Inspiring
January 9, 2008
PeytonT wrote:
> P.S. I know that Firefox provides much better information about errors, and on
> occasion this has been useful to me. But Firefox (a) doesn't recognize all the
> DOM functions I want to use; (b) has its own ideas about what the display
> should look like, messing up my crowded page; and (c) doesn't even recognize my
> use of AJAX , which works fine in Internet Explorer. I don't need to make these
> pages work in Firefox (and my client wouldn't pay for it) since this is in
> effect an INTRAnet, where the users will all be employees of the company
> although not physically located in its offices when the use this intranet.

Then you are going to need to find the IE equivalents of the Firefox
tools that allow one to easily see the request and responses sent
between the client browser and the server. I would guess they probably
exist, but I have no idea of what they are called as I avoid using IE
for debugging purposes.

I usually find it easier to build an application in a complaint form in
Firefox and then modify it slightly to account for IE's eccentricities
rather then the other way around.