jquery - JSON not loading -


having trouble getting json feed load site. i'm starting think wrong feed itself, since plugging address variety of different blocks of example code doesn't seem work.

i've tried examples below, , continually meet "origin null not allowed access-control-allow-origin" when trying deep drill error through chrome's javascript console. ideas?

try #1:

    <script type="text/javascript">         $().ready(function(){              var url = 'http://www.solidverbal.com/category/clicks?feed=json';             $.get(url, function(data) {                 // can use 'data' in here...             });         });      </script> 

try #2:

<script type="text/javascript">         $.ajax({             type: "post",             url: "http://www.solidverbal.com/category/clicks?feed=json",             data: '{}', // parameter goes here             contenttype: "application/json; charset=utf-8",             datatype: "json",             processdata: true,             success: function (msg) {                 loaddetails(msg.d);  // msg.d contains json data being returned             },             error: function (msg, error, obj) {                 alert(msg.responsetext);             }         });           function loaddetails(results) {             // depending on data in json object, can access them using             // syntax results.<propertyname>  etc…         }      </script> 

due same origin policy restrictions not allowed perform cross domain ajax calls. unless page running script hosted on http://www.solidverbal.com won't work. possible workaround use jsonp if remote domain supports or supply server side script on domain serve bridge between domain , remote domain , perform ajax call script.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -