[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 05-14-2006, 09:38 PM   #1 (permalink)
NamePros Member
 
monty's Avatar
 
Join Date: Jun 2005
Location: Hat Yai, Thailand
Posts: 165
104.00 NP$ (Donate)

monty is an unknown quantity at this point


Some AJAX issues

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
monty is offline  
Old 05-14-2006, 10:49 PM   #2 (permalink)
NamePros Regular
 
sjaguar13's Avatar
 
Join Date: Nov 2005
Posts: 382
7.75 NP$ (Donate)

sjaguar13 has a spectacular aura aboutsjaguar13 has a spectacular aura about


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.
__________________
Tiny Atoms | Nonny's | VX8800.com
sjaguar13 is offline  
Old 05-15-2006, 01:05 AM   #3 (permalink)
NamePros Member
 
monty's Avatar
 
Join Date: Jun 2005
Location: Hat Yai, Thailand
Posts: 165
104.00 NP$ (Donate)

monty is an unknown quantity at this point


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
monty is offline  
Old 05-15-2006, 10:49 PM   #4 (permalink)
NamePros Member
 
monty's Avatar
 
Join Date: Jun 2005
Location: Hat Yai, Thailand
Posts: 165
104.00 NP$ (Donate)

monty is an unknown quantity at this point


Bump! Nobody?
monty is offline  
Old 05-16-2006, 05:01 AM   #5 (permalink)
NamePros Member
 
Join Date: May 2006
Posts: 160
81.00 NP$ (Donate)

TwistMyArm is on a distinguished road


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 ).
TwistMyArm is offline  
Old 05-16-2006, 07:35 AM   #6 (permalink)
NamePros Member
 
monty's Avatar
 
Join Date: Jun 2005
Location: Hat Yai, Thailand
Posts: 165
104.00 NP$ (Donate)

monty is an unknown quantity at this point


Quote:
Originally Posted by TwistMyArm
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.
monty is offline  
Old 05-16-2006, 07:57 AM   #7 (permalink)
NamePros Member
 
Join Date: May 2006
Posts: 160
81.00 NP$ (Donate)

TwistMyArm is on a distinguished road


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!
TwistMyArm is offline  
Old 05-16-2006, 07:26 PM   #8 (permalink)
NamePros Member
 
monty's Avatar
 
Join Date: Jun 2005
Location: Hat Yai, Thailand
Posts: 165
104.00 NP$ (Donate)

monty is an unknown quantity at this point


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.
monty is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 03:02 PM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85