2017年9月23日 星期六

JQuery 常用方法

檢測與設定  checkbox
檢測
$('#checkboxId').is(':checked') for verify if is checked
設定
$("#checkboxId").prop('checked', true) to check
$("#checkboxId").prop('checked', false) to uncheck

Struts 1.x html:select 加入id 屬性


<html:select property="myProperty" styleId="myId" >

will translate as

<select name="myProperty" id="myId">

Java 不同編碼字串, 其字串長度大小計算

以 Java 開發專案, 在 DAO 寫入資料庫時, 常遇到JAVA 字串與資料庫編碼不一致, 有時會產生字串過長,導致無法寫入資料庫的情況. 這時就要在入庫前, 先驗證 JAVA 編碼字串是否超出資料庫欄位長度 JAVA 依 不同編碼, 其長度是不一樣的 如: ...