posts - 165, comments - 198, trackbacks - 0, articles - 1
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

dojo 0.9笔记_layout

Posted on 2007-09-07 11:19 G_G 阅读(647) 评论(0)  编辑  收藏 所属分类: javascript Framework
引用 dojo demo  但在IE上总是有问题. 不显示 @#$!*& 郁闷了我一天 ,后来发现 

        <script type="text/javascript">
                dojo.require(
"dijit.layout.LayoutContainer");  //位置和官方的反过来 IE 就没事了 @#$%^!
                dojo.require(
"dijit.layout.ContentPane");   // FF没这问题  .还是FF好啊 大家支持FF   ^_^
     
</script>

<html>
<head>
<title>Layout Container Demo 1</title>
    
<style type="text/css">
        @import "/dojoCharset/js/dojo/dijit/themes/tundra/tundra.css";
        @import "/dojoCharset/js/dojo/dojo/dojo.css"
    
</style>
        
<script type="text/javascript" src="/dojoCharset/js/dojo/dojo/dojo.js"
                djConfig
="parseOnLoad: true"></script>
        
<script type="text/javascript" src="/dojoCharset/js/create/cr.js"
                djConfig
="parseOnLoad: true"></script>        
        
<script type="text/javascript">
                dojo.require(
"dijit.layout.LayoutContainer");
                dojo.require(
"dijit.layout.ContentPane");
     
</script>
</head>
<body class="tundra">

<div dojoType="dijit.layout.LayoutContainer" style="width: 100%; height: 100%">    //开一个 LayOut 空间
   
<div dojoType="dijit.layout.ContentPane" layoutAlign="top" style="background-color:red" href="/dojoCharset/html/top.jsp"> //top
        The Dojo Book
   
</div>
   
<div  dojoType="dijit.layout.ContentPane" layoutAlign="left"  //left
        style
="background-color:lightblue;width: 120px;">
        Table of Contents
    
</div>
    
<div id='div' dojoType="dijit.layout.ContentPane" layoutAlign="client"         //client
        style
="background-color:yellow">
            
<blockquote><href="../node/717">Introduction</a>
                
<ol>
                    
<li><href="../node/718">Dojo: What is It?</a></li>
                    
<li><href="../node/719">History</a></li>
                    
<li><href="../node/733">What Dojo Gives You</a></li>
                
</ol>
                
</blockquote>
    
</div>
</div>       
</body></html>

cr.js
    function on(){
       
function helloPressed(){
               window.alert('ok');
            dojo.xhrGet(
{
                url: '
/dojoCharset/html/top.jsp', 
                handleAs: 
"text",
                encoding: 
"utf-8",
                timeout: 
5000// Time in milliseconds
                load: function(data, ioArgs) {
                    document.getElementById('div').innerHTML 
= data ;
                }

            }
);
        }

              dojo.addOnLoad(helloPressed);         
         
    }

top.js
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//ZH-CN" "http://www.w3.org/TR/html4/strict.dtd">
<%@ page contentType="text/html;charset=gb2312" %> 
<html>
    
<head>
        
<meta http-equiv="Content-Type" content="text/html; charset=GB2312">  
        
<script type="text/javascript"
            src
="/dojoCharset/js/create/cr.js"></script> 
    
</head>
    
<body>
        
<center>
            
<h3>
                
<font color='darkcyan'>
                    大家好
                
</font>
                
<INPUT id='butt' value="list" type="button" onclick="on()"/>
            
</h3>
        
</center>
    
</body>
    
</html>

只有注册用户登录后才能发表评论。


网站导航: