The form is submitted by your submit-action on the button Try re-factor to something like this and add .preventDefault()
HTML
<form id="form1" runat="server">
<input type="text" id="symbol" />
<div id='result'>No Price</div>
<button type="submit">Get Data</button>
</form>
JS
function getData(e) {
//prevent sumbitting the form
e.preventDefault()
var url = "http://query.yahooapis.com/v1/public/yql";
var symbol = $("#symbol").val();
var data = encodeURIComponent("select * from yahoo.finance.quotes where symbol in ('BGG')");
$.getJSON(url, 'q=' + data + "&format=json&diagnostics=true&env=http://datatables.org/alltables.env")
.done(function (data) {
$("#result").text("Bid Price: " + data.query.results.quote.LastTradePriceOnly);
})
.fail(function (jqxhr, textStatus, error) {
var err = textStatus + ", " + error;
$("#result").text('Request failed: ' + err);
});
}
//bind the submit event
$(document).on("submit", "#form1" getData)