【发布时间】:2013-09-12 21:34:28
【问题描述】:
这是原始脚本...
$j(document).ready(function() {
//Show and hide the Loading icon on Ajax start/end
$j('.bwbps_uploadform').submit(function() {
$j('#bwbps_message').html('');
bwbpsAjaxLoadImage(this);
return false;
});
//make sure the upload form radio button is on Select file
$j(".init_radio").attr("checked","checked");
//Add OnClick to the Mass Update Buttons in the PhotoSmash Settings form
if ($j('#bwbps_gen_settingsform').val() == '1') {
bwbpsAddPSSettingsMassUpdateActions();
}
$j('.bwbps-post-cat-form').attr('multiple','multiple');
}
});
我想改变这个脚本在另一个函数中调用它,但是firebug中有语法错误:
var myFunction;
$j(document).ready(function() {
//Show and hide the Loading icon on Ajax start/end
myFunction = function() {
$j('.bwbps_uploadform').submit(function() {
$j('#bwbps_message').html('');
bwbpsAjaxLoadImage(this);
return false;
});
//make sure the upload form radio button is on Select file
$j(".init_radio").attr("checked","checked");
//Add OnClick to the Mass Update Buttons in the PhotoSmash Settings form
if ($j('#bwbps_gen_settingsform').val() == '1') {
bwbpsAddPSSettingsMassUpdateActions();
}
$j('.bwbps-post-cat-form').attr('multiple','multiple');
}
});
怎么了?有谁能够帮我??
var $j = jQuery.noConflict();
感谢您的帮助!
【问题讨论】:
-
应该是
var j = $j = jQuery.noConflict(); -
Firebug 给你的错误是什么
-
这不是问题^^在代码中:var $j = jQuery.noConflict();
-
我不认为这可能是问题,但你错过了函数闭包的分号。