tompi / jeoquery

jQuery wrapper for easily calling geonames.org jsonp services
http://tompi.github.com/jeoquery/
78 stars 15 forks source link

Just not working for me #5

Closed mommaroodles closed 10 years ago

mommaroodles commented 10 years ago

This is my file and I've added the username and it just doesnt want to work for me! What is wrong with this file?

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>Insert title here</title>
        <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
    </head>
    <body class="container">
        <div class="row">
            <p>
                Go on, select a country first... Try viewing the source, the select is
                populated on load by a geonames call.
            </p>
        </div>
        <div class="row well forms-horizontal" id="countrySelect">
            <label for="country">Country: <select id="country" disabled="disabled"></select> </label>
        </div>
        <div class="row">
            <p>
                Next, try to input a postal code for this country, and the place should
                be populated by a geonames service as you leave the input(tab or mouse
                click elsewhere).
            </p>
        </div>
        <div class="row well forms-horizontal" id="postal">
            <label for="postalCode">Postal code:
                <input class="input-small" id="postalCode" type="text" />
            </label>
            <label for="postalPlace">Postal place:
                <input id="postalPlace" type="text"/>
            </label>
        </div>
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
        <script src="js/jeoquery.js"></script>
        <script>
            $(function() {
                jeoquery.defaultData.userName = 'myusername';

                $("#country").jeoCountrySelect({
                    callback : function() {
                        $("#country").removeAttr('disabled');
                    }
                });
                $("#postalCode").jeoPostalCodeLookup({
                    countryInput : $("#country"),
                    target : $("#postalPlace")
                });

            });
        </script>
    </body>
</html>
tompi commented 10 years ago

Sorry, I updated the lib at some time with some input validation which caused problems with the countrypicker... Try getting the latest version of jeoquery.js now, your html should work with it now.