框中的Ajax请求[关闭]

                <div class="grid--cell fl1 lh-lg">
                    <div class="grid--cell fl1 lh-lg">
                        It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and   cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened,   <a href="/help/reopen-questions">visit the help center</a>.

                    </div>
                </div>
            </div>
            <div class="grid--cell mb0 mt8">Closed <span title="2013-02-25 15:58:44Z" class="relativetime">7 years ago</span>.</div>
        </div>
    </aside>

I am working with jquery to build a response box (ajax).

Send request with ajax call and wait for the json response and use the response and show a info box.

JSON returned:

$(document).ready(function(){
    // disable the form submit
    e.preventDefault();
    //Button click event
    $("#operation").click(function(e){
        //Disabling button
        $("#operation").attr('disabled', 'disabled');
        // get the input data
        var input = $("#nameImport").val();
        //Perform POST for triggering long running operation
        $.get('update', {
            name: input
        }, function(data){
            onSuccessImport(data);
        }, "json");
    });
});

Thanks.

</div>

The only problem i see is that the e.preventDefault() should go inside the click handler..

//Button click event
$("#operation").click(function(e){
    // disable the form submit
    e.preventDefault();

and a more generic comment is that you should use .prop to fiddle with DOM properties (instead of .attr)
so use

$("#operation").prop('disabled', true);