为谷歌地图配置jQuery插件

为谷歌地图配置jQuery插件,jquery,google-maps,Jquery,Google Maps,我正在使用这个插件: 守则: <!DOCTYPE html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>

我正在使用这个插件:

守则:

   <!DOCTYPE html>
   <html>
  <head>
   <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />

   <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>

   <script src="//d79i1fxsrar4t.cloudfront.net/jquery.liveaddress/2.4/jquery.liveaddress.min.js">   </script>

 <script>jQuery.LiveAddress("my key");</script>

   <script type="text/javascript">
   var liveaddress = $.LiveAddress({
    key: 'my key',
   debug: true,
    addresses: [{
    id: 'mySubmitButton',      // IDs are not part of the address
    street: '#street_add',
    street2: '#street2',    // Not all these fields are required
    city: '#city',
    state: '#state',
    zipcode: '#postcode',
    country: '#country'
   },
   {

   }]
    });

     </script>  


   </head>
   <body>
    <div id="panel">
       <form action="" name="" method="post">
           <input id="addresses" type="hidden" value="">
           Street Address<input id="street_add" type="textbox" value="" class="address">  <br />
           City<input id="city" type="textbox" value="" class="address"><br />
           State<input id="state" type="textbox" value="" class="address"><br />
           Zipcode<input id="postcode" type="textbox" value="" class="address"><br />
           Country<input id="country" type="textbox" value="" class="address"><br />
           <input type="submit" value="submit" id="#mySubmitButton" />
     </form>
    </div>
    <div id="map-canvas" style="height:40%;top:30px;"></div>
   </body>
   </html>
根据说明,我似乎需要对此进行配置以使其正常工作。我看到正在调用LiveAddress函数,然后我添加了配置部分var LiveAddress
这是否已正确初始化和配置,它是否会连接到表单?

以下是一种基于文档的方法。首先初始化liveaddress对象,并在同一实例中进行映射。现在你已经分别做了。这是不必要的

var l = $.LiveAddress({
    key: 'HTML_KEY',
    debug: true,
    addresses: [{
        id: 'billing',      // IDs are not part of the address
        street: '#street1',
        street2: '#street2',    // Not all these fields are required
        city: '#city',
        state: '#state',
        zipcode: '#zip',
        country: '#country'
    },
    {
        id: 'shipping',     // IDs are optional, but can be helpful
        street: '#addrTb'
    }]
});
然后,您所要做的就是调用verify方法


大多数情况下,您需要在key:HtmlKey中填充此属性
l.verify('billing');