2011-01-26 95 views
0
<script type="text/javascript"> 
var sBasePath = document.location.href.substring(0,document.location.href.lastIndexOf('_samples')) ; 

var oFCKeditor = new FCKeditor('FCKeditor1') ; 
oFCKeditor.BasePath = sBasePath ; 
oFCKeditor.Height = 300 ; 
//documents.write(test); 
**oFCKeditor.Value = '';//i want to assign <%=strPageContent%> here but its not working....** 

oFCKeditor.Create() ;//--> 
</script> 
+1

「不工作」是什麼意思? – skaffman 2011-01-26 12:38:54

+0

即時消息沒有得到<%= strPageContent%>的值。 – Learner 2011-01-26 13:17:21

回答

2

如果你有一個名爲strPageContent變量,則以下工作:

oFCKeditor.Value = '<%=strPageContent%>'; 

如果你把它當作一個請求屬性(request.setAttribute(..)在例如一個servlet設置),而不是作爲一個變量,那麼:

oFCKeditor.Value = '${strPageContent}';