这是我的html code
我要传一个hidden值给ajax
<form action="" method="post" name="<?php echo $number; ?>">
<input type="hidden" name="picurl" value="<?php echo $url_temp; ?>"/>
<input type="submit" value=" Comment_Submit "
class="comment_submit" id="<?php echo $number; ?>" />
</form>
<script type="text/javascript">
$(document).ready(function(){
$(".comment_submit").click(function(){
var element = $(this);
var Id = element.attr("id");
var test = $("#textboxcontent"+Id).val();
var dataString = 'textcontent='+ test + '&com_msgid=' + Id;
var dataVar = $("#picurl").val();
if(test==''){
alert("Please Enter Some Text");
}
else{
$.ajax({
type: "POST",
url: "insertajax.php",
data: {dataString, dataVar},
......
想请问为什么dataString这个variable可以传过去
但是dataVar却无法传过去
拜托版上大大了.....