Unstoppable Domains

Some AJAX issues

Spaceship Spaceship
Watch

monty

Established Member
Impact
3
Hey y'all,

I am working on a AJAX application and having quite a hard time debugging... I am only able to view the source HTML of the landing page, the rest of the server interaction is performed by the AJAX engine and I am not able to view any of the of the HTML send by the server.

Does anybody have a work-around for this issue?

Tnx much!

-monty
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
I would add write statements to everything to see exactly what is happening. Add them above every line or every block of code with a description of what it should be doing. Then you can read what all took place and what was missing. If everything says it worked, print out exactly what each variable was and everything else to see if you can find the spot things begin to change and error out.
 
0
•••
Thanks for replying sjaguar13. Indeed, this might be a solution to the problem. However, it's a rather large application and implementing all this code for debugging will add a lot hours to the development, time which we don't really have.

Furthermore, some time ago I came across an article somewhere on the net describing a work-around for this problem which resulted in all HTML being viewable in the browser. Unfortenately, at that time I didn't really look into it and now I can't find the article again...

-monty
 
0
•••
Bump! Nobody?
 
0
•••
What programming language are you using? Assuming you have a local copy of the server code, it is possible to debug 'server side' code... eg. PHPEclipse lets you debug calls to PHP scripts (not that I've ever got it to actually work, but hey, it's possible :) ).
 
0
•••
TwistMyArm said:
What programming language are you using? Assuming you have a local copy of the server code, it is possible to debug 'server side' code... eg. PHPEclipse lets you debug calls to PHP scripts (not that I've ever got it to actually work, but hey, it's possible :) ).

Thanks for your reaction TwistMyArm! Most of the server site coding is done in PHP and a little bit in Python, both of them cause no problems regarding debugging. What I need is decent client site debugging; a means of being able to view the HTML generated by the server site code.

The problem is that HTML parsed as a reply to requests made by the XMLHttpRequest object is not viewable by the browser. Usually, there are work arounds this by using some server site solution, however the template engine I am using isn't as friendly when it comes to this approach of debugging.
 
0
•••
Well in theory, you'd run the IDE 'client side' and the debugger alongside your Apache / PHP setup 'server side'. You should still be able to step into, through and out of your template engine.

I guess the question is this: are you trying to work out why the browser doesn't show the returned HTML (as in, you know the HTML is broken, but don't know what the HTML is in the first place) or are you trying to work out why the server is returning the HTML that it is (as in, you know what the HTML is and what the error is, but you can't work out why the server is returning that particular piece of HTML).

If the former, then once you work it out, you may still need to look in to the latter option later anyway :) If it is the first problem, then look into using the Javascript debugger in Firefox: that way you should be able to see what the server is returning to you seeing as AJAX runs through Javascript anyway. If it's the second problem, then I'd definitely look at getting the PHP debugger working or resorting to dumping output to a 'log file'.

Good luck!
 
0
•••
Server site debugging is not the problem here, I am able to debug both Python and PHP without any problems.

Furthermore, I know which template which is being send back by the server (so for this part I already know the HTML) I only need to check state on several variables performing key rols in rendering the HTML.

The problem with regards to the template engine is that the variables are build after I started the engine and this engine isn't helpfull in sending seperate bits of data to the client after the template object is created. Ofcourse, for this matter there are also work around possible. However, I know there is a way to display HTML generated by the AJAX engine after the main page has been loaded into the browser.
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back