2012-03-15 47 views
0

我是Rails的新手。我在項目中使用jQuery和jQGrid。我面臨的問題是當我加載頁面時,以下內容顯示在頁面中。我不知道是什麼原因。任何人都可以告訴我這個問題的原因。腳本標記內容打印在頁面

<script src="/javascripts/jqgrid/jquery.js?1331713080" type="text/javascript"></script> 
<script src="/javascripts/jqgrid/jquery-ui-1.7.1.custom.min.js?1331713080" type="text/javascript"></script> 
<script src="/javascripts/jqgrid/jquery.layout.js?1331713080" type="text/javascript"></script> 
<script src="/javascripts/jqgrid/i18n/grid.locale-en.js?1331713080" type="text/javascript"></script> 
<script src="/javascripts/jqgrid/jquery.jqGrid.min.js?1331713080" type="text/javascript"></script> 
<script src="/javascripts/jqgrid/jquery.tablednd.js?1331713080" type="text/javascript"></script> 
<script src="/javascripts/jqgrid/jquery.contextmenu.js?1331713080" type="text/javascript"></script> 

這是我的看法代碼,

<%= stylesheet_link_tag "process_mon/style" %> 
<%= javascript_include_tag "process_mon/conf" %> 
<%= javascript_include_tag "prototype" %> 
<%= javascript_include_tag "process_mon/monitor" %> 
<%= javascript_include_tag "process_mon/validations"%> 
<style> 
     fieldset{ 
       font-family: Times New Roman; 
       font-size: 12; 
     } 
     body { 
       background : #f9f9f3; 
     }   
.tabmenu a, #tabmenu a.active { 
     background: none repeat scroll 0 0 #E6B662; 
     color: #000000; 
     font-size: 12px; 
     font-weight: bold; 
     margin: 0; 
     padding: 3px 8px 1px; 
     text-decoration: none; 
}  
.tabmenu a:link 
{ 
     background: none repeat scroll 0 0 #E6B662; 
     color:#000000; 
     font:bold 14px arial; 
     padding:5px 8px 5px 5px; 
     text-decoration : none; 
} 
.tabmenu a.active 
{ 
     background : none repeat scroll 0 0 #F9F9F3; 
     border-bottom : 3px solid #F9F9F3; 
     color : #000000; 
} 
#navigation ul 
{ 
list-style: none; 
padding: 0; 
margin: 0 
} 
.tabmenu li 
{ 
display: inline; 
list-style-type:none; 
float: left; 
margin: 0; 
margin-left : -41px; 
margin-right: 45px; 
} 
</style> 

<% if params["load"] == "conf" %> 
     <body onLoad="new Ajax.Updater('maindiv', '/processmonitoring/conflist', {asynchronous:true, evalScripts:true});return false;"> 
<% else %> 
     <body onLoad="new Ajax.Updater('maindiv', '/processmonitoring/monitor', {asynchronous:true, evalScripts:true});return false;"> 
<% end %> 
<div id="tabmenu" class="tabmenu" style="position: absolute;width : 100%"> 
<ul id="navigation"> 
         <li><span><%= link_to "Monitor", :update => "maindiv" ,:url => { :controller => 'processmonitoring', :action => 'monitor' }, :complete => 'reset();', :method => 'get' %></span></li> 

         <li><span><%= link_to "Configuration", :update => "maindiv" , :load => "conf" , :url => { :controller => 'processmonitoring', :action => 'conflist' } %><span></li> 

</ul> 
</div> 
<br><br><br> 
<div style="clear:both" ></div> 
<div id="maindiv"> 
</div> 
</body> 
+0

在添加這些腳本的地方,視圖是什麼樣的?他們是逐字還是從幫手? – Emily 2012-03-15 06:04:55

+0

你能否發表你的觀點代碼? – 2012-03-15 06:35:54

+0

我已添加我的查看代碼。 – 2012-03-15 06:56:16

回答

0

我不知道關於這一點,但你可以把你的整個數據標記之間,並把所有的風格之間的JavaScript代碼,並檢查是否是幫助

一定要按照這個模式爲您的網頁

<!DOCTYPE html> 
<html> 
<head> 
    <title>Web page title</title> 
    <script type="text/javascript" src="script.js"></script> 
</head> 
<body> 
    <!-- HTML code here --> 
</body> 
</html> 
0

我知道這是一個OL d的問題,但它可以節省一些時間給別人:

今天我有同樣的問題,我曾在CSS樣式這是根本原因:

body * { 
    display: inline; // or any display value other than none 
} 

*包括script標籤也。