我用<iframe>方式阻止防止提交表单后跳转页面:<form id="set_pic_form" name="set_pic_form" method="post"
action="/xxoo.htm" target="hidden_iframe">
<input type="text" id="pic_url" name="pic_url" />
<input type="submit />
</form>
<iframe name="hidden_iframe" width="0" height="0" scrolling="no">
</iframe>这个表单提交后,会返回一个json格式的数据。大概是这样的:
{
"isSuccess":true,
"msg":"成功"
}
我需要显示这个msg给用户,可以使alert()的格式,请问可以怎么做呢?(关键是,我怎么获取返回的msg)
action="/xxoo.htm" target="hidden_iframe">
<input type="text" id="pic_url" name="pic_url" />
<input type="submit />
</form>
<iframe name="hidden_iframe" width="0" height="0" scrolling="no">
</iframe>这个表单提交后,会返回一个json格式的数据。大概是这样的:
{
"isSuccess":true,
"msg":"成功"
}
我需要显示这个msg给用户,可以使alert()的格式,请问可以怎么做呢?(关键是,我怎么获取返回的msg)
<iframe name="hidden_iframe" width="0" height="0" scrolling="no" onload="var j=eval('('+this.contentWindow.document.body.innerHTML+')');alert(j.msg)">
</iframe>