posts - 37,  comments - 9,  trackbacks - 0
BOM:Browser Object Model,浏览器对象模型。BOM是由一系列的对象组成的。其结构如下图所示。


可以看出,window对象是整个BOM的核心,因此,先讨论window对象。
(1)使用框架集的情况下
        使用框架集合的情况下,每个框架都由他自身的window对象表示,存放在frames集合中。可以通过数字或者名字对框架进行索引。看例子:
<html>
    
<head></head>
    
<frameset rows="100,*">
        
<frame src="frame.html" name="topFrame" />
        
<frameset cols="50%,50%">
            
<frame src="anothorFrame.html" name="leftFrame"/>
            
<frame src="yetAnothorFrame.html" name="rightFrame"/>
        
</frameset>
    
</frameset>
</html>
        我们可以通过window.frames[0]或者window.frames["topFrame"]引用顶层的框架。由于window对象是整个BOM的核心,因此再写上面的代码时,可以忽略window对象不写,直接写frames[0]或者frames["topFrame"]即可。
        在框架中使用window对象,代表的是该框架本身。因此,还引入了top对象。该对象指向的是对顶层的框架,也就是浏览器窗口。
        此外,还有一个parent对象。顾名思义,parent指向该框架的父框架。看例子。
<!--parent.html-->
<html>
    
<head></head>
    
<frameset rows="100,*">
        
<frame src="frame.html" name="topFrame" />
        
<frameset cols="50%,50%">
            
<frame src="anothorFrame.html" name="leftFrame"/>
            
<frame src="anotherframeset.html" name="rightFrame"/>
        
</frameset>
    
</frameset>
</html>
       其中,anotherframeset.html的代码如下:
<!--anotherframeset.html-->
<html>
 
<head>
  
<title></title>
 
</head>
 
<body>
    
<frameset cols="100,*">
        
<frame src="red.html" name="redFrame"/>
        
<frame src="blue.html" name="blueFrame"/>
    
</frameset>
 
</body>
</html>
        如果在red.html或者blue.html中,parent指向parent.html中的rightFrame。如果代码写在parent.html中的topFrame中,那么parent指向top对象,也就是浏览器窗口。还有一个指针self,它总是等于window。

参考书:
《JavaScript高级编程》Nicolas C. Zakas著, 曹力 张欣 等译。
posted @ 2011-10-18 12:22 wawlian 阅读(460) | 评论 (0)编辑 收藏
修改host,加入 

203.208.46.146 www.google.com 
203.208.46.147 www.google.com.hk 
203.208.46.132 clients1.google.com 
203.208.46.149 mail.google.com 
203.208.46.161 chatenabled.mail.google.com 
203.208.46.161 mail-attachment.googleusercontent.com
哈哈,找到解决办法,速度明细加快 
posted @ 2011-10-14 14:56 wawlian 阅读(671) | 评论 (0)编辑 收藏
以下内容均是来自《锋利的jQuery》,发到这里,纯属做个笔记,方便查阅。
直接看代码:

 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 2         "http://www.w3.org/TR/html4/loose.dtd">
 3 <html>
 4 <head>
 5     <title></title>
 6     <script type="text/javascript" src="jquery-1.3.1.js">
 7 
 8     </script>
 9 
10     <script type="text/javascript">
11         $().ready(
12             function() {
13 
14                 //表单对象属性过滤选择器
15                 //1改变表单内可用元素的值
16                 //$('#form1 input:enabled').val("这里变化了");
17 
18                 //2改变表单内不可用元素的值
19                 //$('#form1 input:disabled').val("这里变化了");
20 
21                 //3选取多选框中选中的个数
22                 //alert($('#form1 input:checked').length);
23 
24                 //4选取下拉框中选中的内容
25                 alert($('#form1 select :selected').length);
26             }
27         );
28     </script>
29 </head>
30 <body>
31     <form action="" id="form1">
32         可用元素:<input name="add" value="可用文本框"/><br/>
33         不可用元素:<input name="email" disabled="disabled" value="不可用文本框"/><br/>
34         可用元素:<input name="che" value="可用文本框"/><br/>
35         不可用元素:<input name="name" disabled="disabled" value="不可用文本框"/><br/>
36 
37         <br/>
38         多选框:<br/>
39         <input type="checkbox" name="newsletter" checked="checked" value="test1"/>test1
40         <input type="checkbox" name="newsletter" value="test2"/>test2
41         <input type="checkbox" name="newsletter" value="test3"/>test3
42         <input type="checkbox" name="newsletter" checked="checked" value="test4"/>test4
43         <input type="checkbox" name="newsletter" value="test5"/>test5
44 
45         <div></div>
46         <br/><br/>
47         下拉列表:<br/>
48         <select name="test" multiple="multiple" style="height:100px">
49             <option>浙江</option>
50             <option selected="selected">湖南</option>
51             <option>北京</option>
52             <option selected="selected">天津</option>
53             <option>广州</option>
54             <option>湖北</option>
55         </select>
56 
57         <br/><br/>
58         下拉列表2:<br/>
59         <select name="test2">
60             <option>浙江</option>
61             <option>湖南</option>
62             <option selected="selected">北京</option>
63             <option>天津</option>
64             <option>广州</option>
65             <option>湖北</option>
66         </select>
67 
68         <div></div>
69     </form>
70 </body>
71 </html>
posted @ 2011-06-17 16:51 wawlian 阅读(298) | 评论 (0)编辑 收藏
     摘要: 以下内容均是来自《锋利的jQuery》,发到这里,纯属做个笔记,方便查阅。直接看代码:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->  1 <!DOCTYPE HTML PUBLIC ...  阅读全文
posted @ 2011-06-17 16:11 wawlian 阅读(896) | 评论 (0)编辑 收藏
MyEclipse 9.0 安装了Flash Builder4.5,界面菜单都变成中文的了,完全不适应。
如果不习惯中文界面, 改回英文界面吧。只需要为 flash builder 加上启动参数
" -clean -nl en_US "
完成后记得将 -clean 去掉,以免每次启动 flash builder 都执行清理动作而浪费时间。
posted @ 2011-06-15 14:04 wawlian 阅读(513) | 评论 (0)编辑 收藏

下载正确的版本,然后修改refhost.xml文件


然后解压,在目录中找到refhost.xml(有两个,我的一个是在stage\prereq\db目录下,一个是在stage\prereq\db_prereqs\db目录下)进行添加修,添加如下代码:

<!--Microsoft Windows 7-->
<OPERATING_SYSTEM>
<VERSION VALUE="6.1"/>
</OPERATING_SYSTEM>

注:如果安装的是客户端,将路径中的db改为client即可。

而后还要修改一个oraparam.ini文件,在install目录下

先在[Certified Versions]
#You can customise error message shown for failure, provide value for CERTIFIED_VERSION_FAILURE_MESSAGE
#Windows=5.0,5.1,5.2,6.0,6.1

注:即在#Windows=5.0,5.1,5.2后面添加 ,6.0,6.1

再添加下面代码:

#[Windows-6.1-required]
#Minimum display colours for OUI to run
MIN_DISPLAY_COLORS=256
#Minimum CPU speed required for OUI
#CPU=300
#[Windows-6.1-optional]


以管理员身份运行setup.exe

posted @ 2011-06-02 21:13 wawlian 阅读(642) | 评论 (1)编辑 收藏
 1 //升序插入排序
 2     public static int[] insertSort(int[] a) {
 3         for(int i = 1; i < a.length; i++) {
 4             int j = i-1;
 5             int tmp = a[i];
 6             while(j >= 0 && a[j] > tmp) {
 7                 a[j+1= a[j];
 8                 j = j -1;
 9             }
10             a[j+1= tmp;
11         
12         }
13         
14         return a;
15     }
16     
17     //降序插入排序
18     public static int[] insertSortDesc(int[] a) {
19         for(int j=1; j < a.length; j++) {
20             int i = j - 1;
21             int key = a[j];
22             while(i >= 0 && a[i] < key) {
23                 a[i+1= a[i];
24                 --i;
25             }
26             a[i+1= key;
27         }
28         return a;
29     }
posted @ 2011-05-25 14:02 wawlian 阅读(161) | 评论 (0)编辑 收藏

在flex4中,滚动条是属于group的,flex4中没有了直接的垂直和水平滚动条,取而代之的是用一个group里面包含了一个scroller,这个scroller有2个属性,垂直和水平滚动条。

如果TextArea要隐藏或者显示滚动条,用style
horizontalScrollPolicy和verticalScrollPolicy,而不是3的mx里面的属性。

而将滚动条移至底端,不能直接设置verticalScrollPosition,而用以下方法
<s:TextArea x="30" y="10" width="175" id="txt"/>
<fx:Script>
    txt.text = "xxxx...";
    txt.validateNow();
    txt.scroller.verticalScrollBar.value = txt.scroller.verticalScrollBar.maximum;
</fx:Script>


validateNow方法验证并更新此对象的属性和布局,如果需要的话重绘对象。
这个方法比较重要,因为在flex里面不会像flash设置了text立即就会显示文本的高度和宽度。非要重绘,或者,监听enterFrame或者其它事件,等控件外观更新完成后,才能真正获取到宽度,高度,verticalScrollBar.maximum,等文字相关属性。


posted @ 2011-04-24 17:16 wawlian 阅读(2605) | 评论 (0)编辑 收藏

在开发过程中,我们经常会遇到读取配置文件的情况,对于配置文件的读取,根据环境等情况又各有不同,一般情况下,如果从非jar包中使用相对/路径,比较简单,就不在累述了,而在很多
情况下,我们需要把我们的class打包成jar文件,进行使用,这时就会发现,我们先前如果没有考虑到这些,可能就行不通了,那么,该如何解决呢?方法如下

有如下路径 :
Web-info--|-->classes--->conf-->config.properties
   |-->lib
此时加入我们需要读取config.properties,在不使用jar包时,使用如下方式读取,不失为一种方法:
File f = new File(this.getClass().getResource("/").getPath());
f = new File(f.getPath() + "/conf/config.properties");
注:f.getPath()即为当class所在的绝对路径。如:c:\javasrc\web-inf\classes
然后,对文件对象进行处理,就能把配置信息读取出来了,但是加入如上class被打包成jar文件,那么,在程序执行到这里时,就会无法找到配置文件,那么该如何处理呢?
处理方法如下:
String s_config="conf/config.properties";
 InputStream in = ClassLoader.getSystemResourceAsStream(s_config);
if( in == null ){
 System.out.println( " 打开 " + s_config + "失败!" );
}else
{
Properties properties = new Properties();
properties.load(in);
//
//接下来就可以通过properties.getProperty(String obj)方法对进行配置信息读取了
}

 

本文来自CSDN博客,转自:http://blog.csdn.net/wjmmml/archive/2004/09/27/118404.aspx

posted @ 2011-04-22 20:46 wawlian 阅读(275) | 评论 (0)编辑 收藏
仅列出标题  下一页

<2024年4月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

常用链接

留言簿

随笔分类

随笔档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜