2013-05-07 52 views
1

当我的表单提交时,我使用它将tinymce的内容复制到它为了验证目的而替换的文本区域。TinyMCE开始时不空白

var content = tinyMCE.activeEditor.getContent(); 
$('#article').val(content); 

的问题是,编辑器的内容是在启动时以下(虽然我看到在编辑器中没有):

<span style="position: absolute; top: -999px; left: -999px; font-size: 300px; width: auto; height: auto; line-height: normal; margin: 0; padding: 0; font-variant: normal; font-family: proxima-nova,serif; font-style: italic; font-weight: 100;">BESbswy</span><span style="position: absolute; top: -999px; left: -999px; font-size: 300px; width: auto; height: auto; line-height: normal; margin: 0; padding: 0; font-variant: normal; font-family: proxima-nova,sans-serif; font-style: italic; font-weight: 100;">BESbswy</span><span style="position: absolute; top: -999px; left: -999px; font-size: 300px; width: auto; height: auto; line-height: normal; margin: 0; padding: 0; font-variant: normal; font-family: proxima-nova,serif; font-style: italic; font-weight: 400;">BESbswy</span><span style="position: absolute; top: -999px; left: -999px; font-size: 300px; width: auto; height: auto; line-height: normal; margin: 0; padding: 0; font-variant: normal; font-family: proxima-nova,sans-serif; font-style: italic; font-weight: 400;">BESbswy</span><span style="position: absolute; top: -999px; left: -999px; font-size: 300px; width: auto; height: auto; line-height: normal; margin: 0; padding: 0; font-variant: normal; font-family: proxima-nova,serif; font-style: italic; font-weight: 600;">BESbswy</span><span style="position: absolute; top: -999px; left: -999px; font-size: 300px; width: auto; height: auto; line-height: normal; margin: 0; padding: 0; font-variant: normal; font-family: proxima-nova,sans-se...ont-size: 300px; width: auto; height: auto; line-height: normal; margin: 0; padding: 0; font-variant: normal; font-family: proxima-nova,serif; font-style: normal; font-weight: 400;">BESbswy</span><span style="position: absolute; top: -999px; left: -999px; font-size: 300px; width: auto; height: auto; line-height: normal; margin: 0; padding: 0; font-variant: normal; font-family: proxima-nova,sans-serif; font-style: normal; font-weight: 400;">BESbswy</span><span style="position: absolute; top: -999px; left: -999px; font-size: 300px; width: auto; height: auto; line-height: normal; margin: 0; padding: 0; font-variant: normal; font-family: proxima-nova,serif; font-style: normal; font-weight: 600;">BESbswy</span><span style="position: absolute; top: -999px; left: -999px; font-size: 300px; width: auto; height: auto; line-height: normal; margin: 0; padding: 0; font-variant: normal; font-family: proxima-nova,sans-serif; font-style: normal; font-weight: 600;">BESbswy</span><span style="position: absolute; top: -999px; left: -999px; font-size: 300px; width: auto; height: auto; line-height: normal; margin: 0; padding: 0; font-variant: normal; font-family: proxima-nova,serif; font-style: normal; font-weight: bold;">BESbswy</span><span style="position: absolute; top: -999px; left: -999px; font-size: 300px; width: auto; height: auto; line-height: normal; margin: 0; padding: 0; font-variant: normal; font-family: proxima-nova,sans-serif; font-style: normal; font-weight: bold;">BESbswy</span> 

有谁知道为什么发生这种情况,我该如何预防它?

回答

0

你编辑的内​​容是不可见的,因为它的造型:

top: -999px; left: -999px;是编辑iframe的可见部分之外!