問題が発生した Jquery 1.9.1 に更新しています。Jquery コード自体では、次のようになります。
//Serialize an array of form elements or a set of
//key/values into a query string
jQuery.param = function( a, traditional ) {
var prefix,
s = [],
add = function( key, value ) {
// If value is a function, invoke it and return its value
value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
**Uncaught TypeError: Object function Document() { [native code] } has no method 'apply'**
};
特定のコードにバックトラックできないようです。私は .live('click' を .on('click';
$(document).on("click", "#candidatesubmit", function() {
var strForm = $("form").serialize();
//alert(strForm);
$.ajax({
type: 'POST',
url: 'actEditStatusForm.cfm',
data: strForm,
error: function(xhr, textStatus, errorThrown) {
// show error
alert(errorThrown);
},
success: function(response1, textStatus, jqXHR) {
ColdFusion.Grid.refresh('candidatesGrid', true);
投稿が完了すると、その部分は正常に機能しているように見えます。しかし、次のコードは機能しません。
<cfsavecontent variable="canddivscript">
<script>
function initDateStuff2Script() {
$(function() {
//alert('xxxxx');
$('input.datestuff2').datepicker({dateFormat: 'yy/mm/dd'});
});
}
</script>
</cfsavecontent>
<cfoutput>
<cfhtmlhead text="#canddivscript##chr(13)##chr(10)#">
</cfoutput>
<cfset ajaxOnLoad("initDateStuff2Script")>
class="datestuff2" を持つ特定の 1 つの入力フィールドだけが何かを行います。これは、日付を入力するときにマスク yyyy/mm/dd を設定することです。他の入力フィールドは何もしません。Jquery 1.7に戻すことができると思います
コードはかなり長いので、ここにすべてを投稿することはできません。