如何从JQuery Ui对话框更新页面中的Div?

时间:2011-12-15 18:38:46

标签: javascript jquery html jquery-ui

如何从JQuery UI对话框更新我的页面?这是我的代码到目前为止,并没有工作。任何帮助将不胜感激。

function submit_new_site() {

    //these are the input text id's on the dialog 
    address = $('#loc_address').val();
    city = $('#loc_city').val();
    county = $('#loc_county').val();
    state = $('#loc_state').val();
    zip = $('#loc_zip').val();
    notes = $('#loc_notes').val();

    //and these are the div's on the page that calls the jQuery UI dialog
    $('#new_site').html(address);
    $('#new_site_city').html(city);
    $('#new_site_county').html(county);
    $('#new_site_state').html(state);
    $('#new_site_zip').html(zip);

    //this function is called from a button on the jQuery UI dialog
    //but is not updating the page with the user entered information.       

}

1 个答案:

答案 0 :(得分:0)

尝试$('#loc_address').prop('value')val()不再总是报告当前值,IIRC。