AJAX JSONP实例

2018-01-08 11:46:00
admin
原创
496
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JSONP 实例</title>
</head>
<body>
    <div id="divCustomers"></div>
    
    <script type="text/javascript">
function callbackFunction(result, methodName)
        {
            var html = '<ul>';
            for(var i = 0; i < result.length; i++)
            {
                html += '<li>' + result[i] + '</li>';
            }
            html += '</ul>';
            document.getElementById('divCustomers').innerHTML = html;
        }  

 </script>

 <script type="text/javascript" src="http://code.ybao.org/ajax/jsonp.php?jsoncallback=callbackFunction"></script>
 <!--<script type="text/javascript" src="http://code.gznzit.com/ajax/jsonp.php?jsoncallback=callbackFunction"></script> -->
 </body>
</html>
  • QQ讨论群
  • 关注微信
    • 欢迎咨询
    • 欢迎加入QQ群 16506021
  • 公众号:源宝网络