$.ajax parens - , c-.
{} JS- . , {}, :
options = {
url: '/registrations/copy-field-to-contact',
data: {
id: '<?php echo $registration->ID ?>',
field: field,
data: newText
},
success: function(data){
if (data.success) {
$loadingIcon.hide();
$tr.find('.contact-data').html(newText);
$tr.find('td.form_field_label').removeClass('mismatched');
$tr.effect('highlight', 1000, function(){
$undoLink.fadeIn();
});
} else {
displayErrorMessage(data.error);
$loadingIcon.hide();
$button.show();
}
},
error: function(){
displayErrorMessage('Unknown reason');
$loadingIcon.hide();
$button.show();
}
}
:
$.ajax(options);
, ajax:
# 1 - URL- google
options.url = "http://www.google.com";
$.ajax(options);
# 2 - id ( )
options.data.id = "newID";
JQuery. ID. IE ( getByClassName, ). , , , (getElementsByTagName ).
, .copy-, :
$('#registration-information input.copy-button')
,
$('#registration-information input.copy-button, #registration-information a.copy-button')
IE 6 , , 7, # HTML-. , , , , JQuery.
, :
$('.copy-button')
IE 6 html-, . , var. , , .