如何发送一些参数,它们在页面加载时未定义,我有一个选择框,我还需要将所选值发送到 PHP?所以这里是我的代码
var _data = $('#art:selected').val();
$('#art').live('change', function () {
$selected = $(":selected", this);
id = $selected.val();
_data = id;
});
$('.vla').live('click', function () {
$("#uploadify").uploadifyUpload();
return false;
});
$("#uploadify").uploadify({
'uploader': '/extra/flash/uploadify.swf',
'script': '/admin/uploads/artistsphotos',
'scriptData': { 'title': _data },
'cancelImg': '/images/cancel.png',
'folder': '/img/artists',
'queueID': 'fileQueue',
'auto': false,
'multi': true,
'onComplete': function (a, b, c, d, e) {
console.log(d);
},
'onAllComplete': function (event, data) {
//something here
//alert(data);
}
});
该字段的ID为#art,我在提交时尝试获取选定的值,有什么解决方案吗?