从网址获取json字符串

 
  
html>
<html>
<head>
    <title>从网址获取json字符串title>
    <script type="text/javascript" src="js/jquery-2.1.4.min.js">script>
    <link rel="stylesheet" href="css/bootstrap.min.css"/>
    <link rel="stylesheet" href="css/index.css"/>



head>
<body>
<div class="container">
    <div class="table-container">
    <script type="text/javascript" language="javascript">

        var geocodingAPI = "http://232.34.4.33/yourfile/filename";

        $.getJSON(geocodingAPI, function (json) {
            document.write( "" );
            if (json.length!=0){

                /* loop through array */
                $.each(json.items, function(index, d){
                    document.write( "");
                });
            }
        });
        document.write( "
Object_id:Object_name:Data_object_id:
"+d.object_id+""+d.object_name+""+d.data_object_id+"
"
); script> div> div> body> html>

你可能感兴趣的:(web前端开发)