Hi,
I am brand new to jQuery. So far, so good!
I am trying to have an auto suggest input inside a modal. The modal is based on a tutorial at http://www.queness.com/post/77/simple-jquery-modal-window-tutorial The suggest box is performed by a plugin found on this site:http://www.tomcoote.co.uk/jQueryJSONSuggestBox.aspx
The auto suggest works on its own, but has problems inside a modal.
One question is how to download the data for the auto suggest only after the user clicks and opens the modal? The following will download the data when the page is opened, however, if the modal is never created, there is no need to down load the data:
$(document).ready( function() {
$.getJSON("zipcodes.php",
function(data){
$("input#suggestBox").jsonSuggest(data, {maxResults:20, onSelect:callback} );
}
);
})
See http://www.villascape.net/testing/modal_suggest/ for a working example. It obviously has more problems than just downloading data too soon, but I need to start somewhere. If you have any other suggestions other than preventing data from loading too soon, I would also appreciate those!
Thank you