2013年4月19日 星期五

chrome 開發人員工作字體大小

版本 26.0.1410.64 m

按ctrl +  放大

2013年4月8日 星期一

jq cross domain

jquery:

$.ajax({ type: "GET", url: "http://localhost:8000/aa.php",
  data: {name: 'Chad'},
 dataType: 'jsonp', 
 jsonp: 'jsonp_callback',
success: function(json) { var tt = json; alert(tt); $("#result").html('submitted successfully'); },
 error: function(json) { alert("failure"); $("#result").html('there is error while submit'); } });


/
$jsonp = false;
if ( isset( $_GET[ 'jsonp_callback' ] ) ) {
    $_GET[ 'jsonp_callback' ] = strip_tags( $_GET[ 'jsonp_callback' ] );
    $jsonp              = true;

    $pre  = $_GET[ 'name' ] . '(';
    $post = ');';
} //isset( $_GET[ 'callback' ] )

/* Encode JSON, and if jsonp is true, then ouput with the callback
 ** function; if not - just output JSON. */

$json = json_encode($_GET[ 'name' ]);

//print( ( $jsonp ) ? $pre . $json . $post : $json );
//print($_GET[ 'jsonp_callback' ].'('.$json.')');
echo $jsonp_callback,$_GET['jsonp_callback'] . "(" . $json . ")";
?>