| Lurk all you'd like, but why not register and post some pics? Registering also makes it easier to find the good stuff. Need help? |
|
|||||||
| Register | FAQ | Shooters | Calendar | Reviews | Tutorials | Gallery | Books | Search | Today's Posts | Mark Forums Read |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Beginner grinner
Join Date: Apr 2007
Posts: 9
|
I'm relatively naive (
) on JSON could use a couple questions answered. I am trying to build a SmugMap-like interface from blogs.sun.com/blackbox. The RSS feed has the exact information I need, but you can't load it from a web page because of the security implications (this thread documents it a bit, http://www.dgrin.com/showthread.php?...ghlight=access)So, the JSON questions I have
Paul Monday |
|
|
|
|
|
#2 |
|
Beginner grinner
Join Date: Apr 2007
Posts: 9
|
Follow-up, Chattin' with myself
In talking with a few folks here and looking around the net a bit, it looks like pure use of JSON still requires that I load the document from a different domain, thus forcing the sandbox security violation...bummer for me.
The solution, theoretically (with respect to JSON), is JSONP...but this appears to be enabled by the server side (y'all at SmugMug)... Alternatives appear to be - I could author a proxy javascript somewhere and put it on our server (not possible since I'm pure client side but is very similar to what I'm doing today anyway) - I could use some IFrame hack that I don't understand yet (and I'm not sure if I could implement in the blogging infrastructure) Still trying to figure this out though...there's got to be a more direct way to replace my current polling application on my pc that reformats info into javascript variables, uploading it to a middle-man web site and importing the .js from my client. I suspect the google maps api, while not json, is a bit more like one would expect a pure client API to be like (import a javascript library and use it directly). That's an interesting solution since, technically, it seems like you have the same so called security violation as the remote document loading ![]() Paul |
|
|
|
|
|
#3 |
|
Big grins
Join Date: Apr 2007
Posts: 18
|
You should be able to use this library to get around the cross domain security issue from your server .
http://www.xml.com/pub/a/2005/12/21/...cript-tag.html Kevin |
|
|
|
|
|
#4 | |
|
Beginner grinner
Join Date: Apr 2007
Posts: 9
|
Quote:
Here is the example of the callback function supported in a json service: http://developer.yahoo.com/common/js...#callbackparam Here is another example in the Google service: http://googlemapsapi.blogspot.com/20...side-maps.html Is there support for a callback on the SmugMug JSON API, I didn't see it anywhere? Paul |
|
|
|
|
|
|
#5 | |
|
technicolored
Join Date: Nov 2004
Location: Melbourne, AU
Posts: 4,308
|
Quote:
var oJSON = eval('(' + response + ')'); also, you might want to read this article about how to proxy xmlhttp requests to get around cross domain security. |
|
|
|
|
|
|
#6 | |
|
Big grins
Join Date: Jan 2007
Posts: 20
|
Quote:
you might want to read this article about yahoo's json api. |
|
|
|
|
|
|
#7 | |
|
Beginner grinner
Join Date: Apr 2007
Posts: 9
|
Quote:
|
|
|
|
|
|
|
#8 | |
|
technicolored
Join Date: Nov 2004
Location: Melbourne, AU
Posts: 4,308
|
Quote:
I'm adding a JSONCallback parameter, I will let you know when it's released. |
|
|
|
|
|
|
#9 | |
|
Beginner grinner
Join Date: Apr 2007
Posts: 9
|
Quote:
Thanks, Paul |
|
|
|
|
|
|
#10 | |
|
Big grins
Join Date: Jan 2007
Posts: 20
|
Quote:
|
|
|
|
|
|
|
#11 | |
|
technicolored
Join Date: Nov 2004
Location: Melbourne, AU
Posts: 4,308
|
Quote:
|
|
|
|
|
![]() |
| Tell The World! |
| Thread Tools | |
| Display Modes | |
|
|