BlogJava 联系 聚合 管理  

Blog Stats

文章分类

收藏夹

随笔档案

文章档案

Java相關技術


kait

2011年5月1日 #

jquery 提供一個很 fancy selector幫助我們很容易的找到要控制的 dom 元件

jquery 做法:

$(“input[name^='word']).each(function(){

 alert( $(this).val() );

})

$("input[name^='word']") 是指所有inputname只要是 word 開頭的都抓出來,若然有1form以上,並且不同form有相同欄位名稱時,這樣抓可能會出錯,所以需要再把 form考量進來。

$("form[name='form1'] input[name^='nextSign']").each(function(){

 alert( $(this).val() );

})

jquery selector 有個特色,可以將不同的 selector 組合使用,這樣幾乎沒有找不到的DOM物件。

attribute 抓物件方式還有

[attribute*=value] 只要出現value關鍵字

[attribute$=value] value關鍵字結尾

[attribute!=value] value關鍵字不能出現


文章來源:

http://itfarmer.pixnet.net/blog/post/15526223-%5Bjquery%5D%E8%B6%85%E7%B4%9A%E5%BC%B7%E5%A4%A7%E7%9A%84-selector

 

posted @ 2012-09-03 17:57 小天 阅读(321) | 评论 (0)编辑 收藏

REGEDIT

[HKEY_LOCAL_MACHINE\Software\CLASSES\*\shellex\ContextMenuHandlers\UltraEdit-32]
@="{b5eedee0-c06e-11cf-8c56-444553540000}"

[HKEY_LOCAL_MACHINE\Software\CLASSES\CLSID\{b5eedee0-c06e-11cf-8c56-444553540000}]
@="UltraEdit-32"

[HKEY_LOCAL_MACHINE\Software\CLASSES\CLSID\{b5eedee0-c06e-11cf-8c56-444553540000}\InProcServer32]
@="C:\\Program Files (x86)\\IDM Computer Solutions\\UltraEdit\\ue32ctmn.dll"
"ThreadingModel"="Apartment"

然後將 C:\\Program Files (x86)\\IDM Computer Solutions\\UltraEdit 改成你所安裝ultraedit所在路徑,
再將上面資料存成 ultraedit.reg,接著再雙擊它,進行註冊,就可以了~~
posted @ 2011-10-04 16:46 小天 阅读(1072) | 评论 (0)编辑 收藏

Step 1: 新增一個文字檔,並將副檔名改為:  xxxx.bat  (xxxx 由自己隨意命名)

 

Step 2: 輸入以下網路設定指令

           netsh interface ip set address "區域連線" static IP位置 子網路遮罩 預設閘道 1

           netsh interface ip set dns "區域連線" static 慣用DNS伺服器

           netsh interface ip add dns "區域連線" 其他DNS伺服器

 

          例如:

          netsh interface ip set address "區域連線" static 192.168.2.1 255.255.255.0 192.168.2.254 1

          netsh interface ip set dns "區域連線" static 168.95.1.1


在win7的環境,記得要用系統管理者的權限才可執行此批次檔~~


參考網址:

http://www.dotblogs.com.tw/satan45/archive/2010/08/05/17037.aspx
http://jemmywalker.pixnet.net/blog/post/38324489-%E8%A8%AD%E5%AE%9A%E7%B6%B2%E8%B7%AFip%E6%89%B9%E6%AC%A1%E6%AA%94
http://bbs.ee.nchu.edu.tw/gemmore/wufish&F10VCR0B&56

posted @ 2011-09-19 10:05 小天 阅读(229) | 评论 (0)编辑 收藏


今天看到有篇文章寫到 windows.open 可以post方式傳遞參數,就趕緊照作看看,結果是可行的,
感謝撰寫這篇文章的作者~

/**
 * window.open with post method
 */
function openWindowWithPost(url, name, keys, values) {
    var newWindow = window.open(url, name);
    if (!newWindow){
        return false;
    }
    
    var html = "";
    html += "<html><head></head><body><form id='formid' method='post' action='"    + url + "'>";
    if (keys && values && (keys.length == values.length)){
        for ( var i = 0; i < keys.length; i++){
            html += "<input type='hidden' name='" + keys[i] + "' value='" + values[i] + "'/>";
        }
    }
    html += "</form><script type='text/javascript'>document.getElementById(\"formid\").submit()</script></body></html>";
    newWindow.document.write(html);
    return newWindow;
}

詳細參考網址:http://www.dotblogs.com.tw/puma/archive/2008/09/03/5288.aspx
posted @ 2011-05-27 00:20 小天 阅读(5645) | 评论 (0)编辑 收藏


當使用eclipse的maven:出现Missing indirectly referenced artifact com.sun:tools:jar:1.5.0:system 错误,是因为需要jdk的tools。
根本原因是没有指定javaw.exe的的位置,所以在eclipse.ini中用-vm指定javaw的位置就可以了~
一定要在 openFile 以下加才行,在別的地方加,都會無效~

-startup
plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.2.R36x_v20101222
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vm
C:/java/jdk1.6.0_21/bin/javaw.exe

-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m


參考網址: http://blog.csdn.net/gongchenzhang/archive/2010/09/03/5861056.aspx


posted @ 2011-05-09 21:44 小天 阅读(2406) | 评论 (0)编辑 收藏

struts2與Servlet共存的設定方法

在 web.xml 下加入以下設定, 否則 servlet 會被 struts2 給濾掉,若有用spring的話,也得要設定

 <filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>*.action</url-pattern>
  </filter-mapping>
  <filter-mapping>
    <filter-name>spring filter</filter-name>
    <url-pattern>*.action</url-pattern>
  </filter-mapping>
posted @ 2011-05-09 01:20 小天 阅读(485) | 评论 (0)编辑 收藏



參考網址:
http://olex.openlogic.com/packages/itext/2.0.2#package_detail_tabs

修正表格中,有中文的問題
http://myned.blogspot.com/2008/10/javafw-java-itext-pdf.html

以下網址,是說可以將html的內容轉給 iText的document,再將其內容輸出成pdf,
這樣的做法感覺很方便,比較好調整pdf的版面~~
http://tomkuo139.blogspot.com/2010/03/java-itext-html-pdf.html

posted @ 2011-05-01 00:38 小天 阅读(355) | 评论 (0)编辑 收藏