主要是用一个ckeditor但是发现,如果放在<head>标签中就不能正常显示,但是放到最下面</html>标签外就能正常显示了,这是什么原因呢?
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'ckEditor.jsp' starting page</title>

    <script type="text/javascript" src="ckeditor/ckeditor.js"></script>

  </head>
  
  <body>
    This is my JSP page. <br>
    <textarea id="editorTest" name="editorTest" rows="" cols="">This is ckEditor test</textarea>
  </body>
</html>
<!-- 以下这段代码如果放到<head>标签中就不能运行 -->
<script type="text/javascript">
CKEDITOR.replace('editorTest');
</script>