|
|
|
<script type="text/javascript">// This is our function to be called with JSON datafunction tet(data){ alert("ty: " + data.a + ", tr: " + data.b);}var url = "http://ganbaobao.com.cn/test.php?callback=tet"; // URL of the external script// this shows dynamic script insertionvar script = document.createElement('script');script.setAttribute('src', url);// load the scriptdocument.getElementsByTagName('head')[0].appendChild(script); </script> $prot = array('a'=>'121abc','b'=>'11a1b12c','c'=>'11assbc','d'=>'11ffgaerbc','e'=>'11adsabc');$json = JSON($prot);echo $_GET['callback'].'('.$json.')'; |
|