Cross domain jsonp

WE HAVE MOVED!

Please visit our new Drupal Website at https://www.xenyo.com我們的新網頁設計公司網頁.

function crossript(nid) {
  var urlto = "http://www.xxx.com/xxx.php?url=http://www.xxx.com/" + nid;
  $.ajax({
    url:urlto, 
    dataType:"jsonp",
    jsonp : "callback",
    success:function(data){
     console.log(data.message);
    }
  })
}
/***** php ****/
<?php
 header("content-type: application/json"); 
$url = $_GET['url'];
$obj = new stdClass;
$obj->message = $result;
echo $_GET['callback']. '('. json_encode($obj) . ')';  
?>
Help Share this Article