By mswatcher
via refact.blogspot.com
Published: Jun 28 2008 / 09:02
Use JQuery to consume JSON Web Services is a lightweight method, for increment performance in your website.
If you want call a JSON Web Service from your javascript code, you should : use HTTP POST and content-type "application/json; charset=utf-8″. Asp.Net Ajax make this for you transparently.
SaveShareSend
Tags: ajax, javascript
Comments
kenman replied ago:
Not a good article at all. Makes a couple blanket statements that you should do things a certain way, but never supports the argument himself....just links to another [much better-written] article:
http://weblogs.asp.net/scottgu/archive/2007/04/04/json-hijacking-and-how-asp-net-ajax-1-0-mitigates-these-attacks.aspx
Also uses $(document).loadMyContent(...), which is NOT a standard jQuery method, and is most likely a custom plugin by the author...but he mentions nothing about it (nor gives sourcecode for it), so simply dropping this code into your page will not work.
Lastly he uses data: "{}", which is incorrect usage. Although that *may* work, the data param expects an object, so in fact that line should read data: {}.
Voting down for the quality of the article (and not the subject matter).
Sanjeevana replied ago:
Check this article explain more about JQuery and JSON web service
http://www.dzone.com/links/dynamically_create_aspnet_user_control_using_jque.html
Voters For This Link (6)
Voters Against This Link (1)