2013-05-07 84 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的可見部分之外!