【发布时间】:2010-01-28 11:54:05
【问题描述】:
我正在为一个项目使用所见即所得插件 (http://code.google.com/p/jwysiwyg/),如果 textarea 为空或在提交表单之前不向用户发出警报,我会得到,但这个插件创建了一个 iframe,我无法得到它.
这是由插件生成的 html,将 textarea 替换为 id #testo
<p><div class="wysiwyg" style="width: 896px;">
<div style="clear: both;"><!-- --></div>
<iframe tabindex="0" id="testoIFrame" style="min-height: 130px; width: 888px;" src="javascript:false;" frameborder="0">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body style="margin: 0px; font-family: Arial,Helvetica,sans-serif; font-size: 12px;">
your text here
</body>
</html>
</iframe>
</div>
<textarea style="display: none;" id="testo" name="testo" rows="8">
</textarea></p>
文本区域不显示。 如果 iframe 中没有文本,我会在内容 div 中添加一个类:
$('#testo').addClass('border');
【问题讨论】: