Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('#searchInput').keyup(function() {
- var searchField = $('#searchInput').val();
- var searchExp = new RegExp(searchField, "i");
- $.getJSON('/Lobster/wp-content/themes/Lobster/business-info.php', function(data) {
- var listing = '<div id="resultsList">';
- $.each(data, function(key, val) {
- // var lng = (val.longitude);
- // var lat = (val.latitude);
- // var coord = [lng, lat];
- if ((val.name.search(searchExp) != -1) ||
- (val.street.search(searchExp) != -1) ||
- (val.town.search(searchExp) != -1) ||
- (val.zip.search(searchExp) != -1)) {
- listing += '<div id="listing">';
- listing += '<h3>' + val.name + "</h3>";
- listing += '<p>' + val.street + " " + val.town + ', ME ' + val.zip + "</p>";
- listing += '<button class="submitNew" id="submitNew">' + 'Submit new price' + '</button>';
- listing += "</div>";
- }
- });
- listing += "</div>";
- $('#resultsContainer').html(listing);
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement