2011-12-15 48 views
0

如何從JQuery UI對話框更新我的頁面?這是我的代碼到目前爲止,並沒有工作。任何幫助將非常感激。如何從JQuery Ui對話框更新頁面中的Div?

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.  

} 
+3

請更多代碼。這些行在哪裏執行? – 2011-12-15 18:39:52

+0

看到jsFiddle上的代碼會很有幫助。什麼不工作? – 2011-12-15 18:40:46

回答

0

嘗試$('#loc_address').prop('value')代替。 val()不再總是報告當前值,IIRC。

相關問題