我有两个php文件,其中一个是通过url执行的,该文件使得ajax调用第二个php文件。一些AJAX结果返回HTML内容作为结果,其中有一些JavaScript事件。这些事件并不奏效,所以我每次调用Ajax调用JS事件返回HTML内容时都会包含js文件。我不认为这是正确的方法。 eventhough 我使用Ajax的 '活' 事件返回的HTML内容怀疑在PHP文件中包含js文件
但什么是正确的方式
function show_regfunc_to_box(this_id){
var enc_item_id = this_id;
enc_item_id = enc_item_id.split("--")[1];
regfunc_to_item_id_hidden = '#regfunc_to_item_id_hidden--'+enc_item_id;
item_id = $(regfunc_to_item_id_hidden).val();
var current_action_regfunc_to_id = '#current_action_regfunc_to_id--'+enc_item_id;
if(($(current_action_regfunc_to_id).css('display'))=='none'){
$.getJSON('./ajax_funcs.php?func=regfunc_to_box',{item_id_regfunc_to:item_id,enc_item_id:enc_item_id},function(data){
$('.current_action_regfunc_to_and_chfunc').hide();
$(current_action_regfunc_to_id).center_box();
$.post('./ajax_funcs.php?func=regfunc_to_box',{enble_js_file:true});
$(current_action_regfunc_to_id).html(data.regfunc_box_html);
//$(current_action_regfunc_to_id).center_box();
$(current_action_regfunc_to_id).show();
});
}
//cls_i_item_options();
}
elseif($_REQUEST['func']=='regfunc_to_box'){
require_once('./js/jq_funcs.js');
ajax_fcs::regfunc_to_box($_REQUEST['item_id_regfunc_to'],$_REQUEST['enc_item_id']);
}
向我们展示一些代码,BC一些你写了,可能没有赚那么多道理,直到我们可以撒尿你的意思 – Neal 2011-04-13 16:16:44
现场甚至应该工作为jj加载内容。如果你粘贴我们的代码,我们可能会帮助 – 2011-04-13 16:18:02