所以我使用加载函数将数据传递给另一个名为compare_proc.php的文件..我创建了一个变量,用于存储要传递的数据,它们是数字..当我提醒这些变量,数据是存在的,但是,当我通过加载功能,将数据传递,变量的内容迷路..下面是相关的代码我的jquery不能识别变量值有什么问题
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#mycarousel').jcarousel();
$("a.inline").colorbox({iframe:true, width:"80%", height:"80%"});
$("#opposition a").click(function(e) {
var first_id = $(this).attr('id'); // value of first_id is 10
var second_id = $("h1").attr('id'); // value of second_id is 20
$("div#test").load('compare_proc.php','id=first_id&id2= second_id');
e.preventDefault();
});
});
然而,装载功能通过first_id而不是10到id和second_id而不是20到id2 ..我哪里错了?
谢谢,我忘了这一点! – 2013-04-21 07:18:23