Commit 3a65a8c1 authored by David Reese's avatar David Reese
Browse files

Reveal modal: Fix confusing AJAX example

The .done() callback receives the data from the $.ajax request; if the request format is HTML, that `resp` will just be a string, not an object. So `resp.html` returns undefined and is non-sensical. This only makes sense if the request format is JSON.

Since my impression is most people are going to be hitting a URL that returns HTML, I'd suggest just changing the example to `$modal.html(resp)` as I've done in this pull request. If you expect most people to be making a request that returns JSON, I would at least imply that in the URL, eg `$.ajax('/api/url.json')`.
parent 35403dba
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment