根据公式 'hidden_'{index}'_'{div_name} 制定具有两个隐藏 div 的自己的标准:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="jquery1.10.js"></script>
<script>
$( document ).ready(function()
{
$('div').click(function()
{
var element = $(this).attr( "id" );
var value1 = $('#hidden_1_'+element).attr( "value" );
var value2 = $('#hidden_2_'+element).attr( "value" );
$_data = 'var1='+value1+'&var2='+value2;
$.post("script.php",$_data,
function(data)
{
response = jQuery.parseJSON(data);
console.log(response);
}
);
});
});
</script>
</head>
<body>
<div id="one">
Hello World 1
<input type="hidden" id="hidden_1_one" value="1">
<input type="hidden" id="hidden_2_one" value="2">
</div>
<div id="two">
Hello World 2
<input type="hidden" id="hidden_1_two" value="3">
<input type="hidden" id="hidden_2_two" value="4">
</div>
</body>
</html>
然后对script.php进行编码,响应为json...
然后使用这两个对象,您可以做任何您想做的事情,然后查看http://api.jquery.com/jQuery.ajax/#example-3