Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is JSONRequest a global Javascript object?

My goal is to asynchronously call a URL via POST request (REST Webservice) to increment a statistic on one of my object.

I am a newby web developer and I discovered JSON yesterday. Since JSON seems a lot popular and handy I went to www.json.org and discovered a JSONRequest object which seems to able one to send POST/GET request asynchronously but I can't get it work.

Is it a global JavaScript object or do I need to add some files ? I am a little bit confused since I've found a Firefox plugin extension for JSONRequest but I don't understand its purpose.

like image 358
Anth0 Avatar asked May 10 '10 10:05

Anth0


People also ask

Is a JavaScript object a JSON object?

JSON is a text-based data format following JavaScript object syntax, which was popularized by Douglas Crockford. Even though it closely resembles JavaScript object literal syntax, it can be used independently from JavaScript, and many programming environments feature the ability to read (parse) and generate JSON.

Is JSON a valid JavaScript object?

The answer is "no". There are cases when JSON object won't be valid for JavaScript. JSON is NOT a JavaScript subset.

What is the difference between JavaScript object and JSON object?

JavaScript Objects VS JSONJSON cannot contain functions. JavaScript objects can contain functions. JSON can be created and used by other programming languages. JavaScript objects can only be used in JavaScript.

What is the JSON request?

JSONRequest is proposed as a new browser service that allows for two-way data exchange with any JSON data server without exposing users or organization to harm. It exchanges data between scripts on pages with JSON servers in the web.


1 Answers

From the website:

JSONRequest is proposed as a new browser service that allows for two-way data exchange with any JSON data server without exposing users or organization to harm.

The proposal doesn't link to an implementation in JS, so it is nothing more then a proposal which may or may not have implementations in the wild (you found the Firefox plugin).

This isn't something that is usable in the real world.

If you want to deal with JSON and XHR, then YUI and jQuery have helper functions which can do things with JSON automatically. Other libraries probably have similar features.

like image 126
Quentin Avatar answered Oct 08 '22 20:10

Quentin