NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Some AJAX issues

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

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 05-14-2006, 10:38 PM THREAD STARTER               #1 (permalink)
NamePros Member
 
monty's Avatar
Join Date: Jun 2005
Location: Hat Yai, Thailand
Posts: 165
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, 11:49 PM   #2 (permalink)
NamePros Regular
 
sjaguar13's Avatar
Join Date: Nov 2005
Posts: 383
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.
__________________
Theme Mine | LA Criminal Lawers |
sjaguar13 is offline  
Old 05-15-2006, 02:05 AM THREAD STARTER               #3 (permalink)
NamePros Member
 
monty's Avatar
Join Date: Jun 2005
Location: Hat Yai, Thailand
Posts: 165
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, 11:49 PM THREAD STARTER               #4 (permalink)
NamePros Member
 
monty's Avatar
Join Date: Jun 2005
Location: Hat Yai, Thailand
Posts: 165
monty is an unknown quantity at this point
 



Bump! Nobody?
monty is offline  
Old 05-16-2006, 06:01 AM   #5 (permalink)
NamePros Member
Join Date: May 2006
Posts: 160
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, 08:35 AM THREAD STARTER               #6 (permalink)
NamePros Member
 
monty's Avatar
Join Date: Jun 2005
Location: Hat Yai, Thailand
Posts: 165
monty is an unknown quantity at this point
 



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, 08:57 AM   #7 (permalink)
NamePros Member
Join Date: May 2006
Posts: 160
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'.
????: NamePros.com http://www.namepros.com/programming/197434-some-ajax-issues.html

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


Liquid Web Smart Servers  
All times are GMT -7. The time now is 02:53 PM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger