My Ajax call replace a dropdown box,  then call
$('select').each(function () {
              $(this).selectBox();
            });

to update the jquery selectBox look and feel again.

but it caused the "setting is undefined: settings.menuTransition" error,

to fixed that need add

            $('select').each(function () {
                $(this).selectBox('destroy');
              
            });
Before the Ajax Call, so the next time you Initial it .the dropdown will be function..

 
Categories: JQuery

September 16, 2011
@ 12:44 AM
check the JQuery Ajax:
$.ajax({
type: "POST",
url: this.url,
data: form_data,
beforeSend: function() {
$('#ajaxDetails').addClass('progress');
},
error: function() {
$('#status').text('Update failed—try again.').slideDown('slow');
},
success: function() {
$('#status').text('Update successful!');
},
complete: function() {
$('#ajaxDetails').removeClass('progress');
setTimeout(function() {
$('#status').slideUp('slow');
}, 3000);
}
});

to get the from data:
var form_data = $("form").serialize();
var form_data_array = $("form").serializeArray();
a simple example:
$(document).ready(function() {
$('#submit').click(function () {
var name = $('.uname').val();
var data = 'uname=' + name;
$.ajax({
type:"GET",
url:"welcome.php",
data: data,
success: function (html) {
$('#message').html(html);
}
});
return false;
});
});


and MVC3 Ajax
@using (Ajax.BeginForm(       
"ActionName",
"ControllerName",
new AjaxOptions {
 UpdateTargetId = "modal-dialog",
OnFailure="searchFailed",
OnBegin = "Dialog.Updating()",
OnSuccess = "Dialog.Update({title:'Select Friends'})"
})) {
… <input type="submit" value="Next" />
}





 
Categories: JQuery | MVC