解决跨域问题:
使用script标签向另一个域上的资源进行请求,传递参数fn,保存将来要执行的js函数名
<script>
function callback(msg){
alert(msg)
}
</script>
<script src="http://www.b.com?fn=callback"></script>
<?php
$str = 'Hello zhangSan';
$fn = $_GET['fn'];
echo $fn.'("' .$str '")';
..