iframe和Ajax $ .post

时间:2011-07-01 20:50:33

标签: ajax iframe .post

我在一个函数中使用$ .post而且我得到$是未定义的。这是在iframe中的onchange事件。为什么会出现这个错误?

 script type="text/javascript">
 function photoupdate(id, name, value, chk)
{
    if(chk==false)
    {
        value="";
    }
    $.post('photoupdate.php', {id: id, name: name, value: value})
};
 </script>


 <input type="radio" name="PrimaryPhoto" id="'.$recordid.'" value="Yes" '.$checked.' 
 style="position:relative; left:-20px; bottom:5px; margin:0px" 
 onchange="photoupdate(this.id, this.name, this.value, this.checked)"/>

1 个答案:

答案 0 :(得分:0)

你需要确保iframe内容有自己的html / head / script src = jquery.js和诸如此类的东西。