0
我使用這個插件: http://smartystreets.com/kb/liveaddress-api/plugin/configure配置一個jQuery插件谷歌地圖
驗證碼:
<!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 live address) 這是否被正確初始化和配置,看起來好像會連接到表單?
最DEF,你需要這個屬性填寫'鍵:「HtmlKey」' – DevZer0
是的,我有。 –