Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^4: Perl json parser and JSONP issue

by heatblazer (Scribe)
on Jun 15, 2012 at 15:12 UTC ( #976443=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Perl json parser and JSONP issue
in thread Perl json parser and JSONP issue

Well you are right... it`s kind of confusing... So if I am right, every time I create and record a JSON, I have to convert it to JSONP with wrapping it with the function before calling it back...


Comment on Re^4: Perl json parser and JSONP issue
Re^5: Perl json parser and JSONP issue
by tobyink (Abbot) on Jun 15, 2012 at 15:35 UTC

    Typically you'd configure your web server (or some other piece of middleware) to convert your JSON to JSONP on the fly. I'm surprised there isn't an Apache mod_jsonp that I can point you towards.

    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

      Thank you. Your help is most appreciated. It was enough :) I`ve understand it. However it`s kind of confusing to me that JSONP stuff... By the way... can`t I just have a js file with a plain

      var Obj = { foo: function() {return me;}, data: "str", id: 0x8888 };

      can`t tell what`s the big fuss of JSON.

        "By the way... can`t I just have a js file"

        You can.

        "can`t tell what`s the big fuss of JSON."

        If you serve your data as a Javascript file, it can only be read by Javascript. If you serve it as JSON, it can be read by any language which has a JSON module available. (Which is pretty much all of them.)

        perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://976443]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2014-10-02 11:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (54 votes), past polls