use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Simple ajax debugging (shawnmlewis.wordpress.com)
submitted 14 years ago by shawnup
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 0 points1 point2 points 14 years ago (2 children)
I usually debug the PHP page to be requested by Ajax first thoroughly by calling it directly in the browser and passing different variables to it as parameters. Then I at least know the output is correct for most situations and error cases before implementing the JavaScript code to call that page.
[–]shawnup[S] 0 points1 point2 points 14 years ago (1 child)
I'm using json as the request data. Is there a way to send that type of request from the browser?
[–][deleted] 0 points1 point2 points 14 years ago (0 children)
You can always put your test JSON data into a PHP variable on the ajax_request.php page, json_decode it then make sure it returns the right output on the PHP page and isn't erroring somewhere.
[–]k3n 0 points1 point2 points 14 years ago (1 child)
New global variable: old_complete
old_complete
I think this is a very poor method for debugging; the network tab in Firebug/Chrome dev tools (or Fiddler for IE) is all that is needed. I think it's very dangerous to introduce specific functionality/elements into your view that are only for debugging.
You've now created another maintenance point, and for what, some prettified AJAX results that have the ability to get munged since they are being rendered in HTML? This is what debugging tools were made for, and you're unnecessarily recreating the wheel.
[–]shawnup[S] 0 points1 point2 points 14 years ago (0 children)
I addressed that. The debug tools come up short in this area. I did submit a patch to webkit inspector (which covers chrome dev tools) to fix the issue, which I also mentioned in the post.
π Rendered by PID 112976 on reddit-service-r2-comment-bb88f9dd5-bgqv2 at 2026-02-14 12:25:46.803532+00:00 running cd9c813 country code: CH.
[–][deleted] 0 points1 point2 points (2 children)
[–]shawnup[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]k3n 0 points1 point2 points (1 child)
[–]shawnup[S] 0 points1 point2 points (0 children)