1

I use jquery-ui plugin and I need to load data from a remote url. I used following code and it doesnt work. Can any one help me.

        $( "#metadata" ).combobox({ 
            source: "metadata/retrievejson",
        });

Thank you

1
  • Could you link to the plugin you're using? Commented Aug 20, 2011 at 8:41

2 Answers 2

2

you should look at this link in the doc. It shows how to retrieve data asynchronously.

your code should look something like this

$( "#metadata" ).combobox({ 
            source: function( request, response ) {
                $.ajax({
                    url: "http://ws.geonames.org/searchJSON",
                    dataType: "jsonp",
                    success: function( data ) {
                     response(data);
                    }
                });
            }
        });
Sign up to request clarification or add additional context in comments.

Comments

1

The autocomplete plugin works as stated by Amin Eshaq, however, the combobox (1) does not have support for remote data, since it's using selectbox.

You could consider extending autocomplete with a button triggering the search event with the text from the autocomplete field.

.autocomplete("search", [value])

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.