- May 28 Tue 2013 10:06
-
php|phpExcel筆記
- May 14 Tue 2013 17:16
-
JQ|判斷是否為手持裝置瀏覽(userAgent)
/*判斷是否為手持裝置*/
function is_mobile() {
var mobiles = new Array("midp", "j2me", "avant", "docomo", "novarra",
"palmos", "palmsource", "240x320", "opwv", "chtml", "pda",
"windows ce", "mmp/", "blackberry", "mib/", "symbian", "wireless",
"nokia", "hand", "mobi", "phone", "cdm", "up.b", "audio", "sie-",
"sec-", "samsung", "htc", "mot-", "mitsu", "sagem", "sony", "alcatel",
"lg", "eric", "vx", "NEC", "philips", "mmm", "xx", "panasonic",
"sharp", "wap", "sch", "rover", "pocket", "benq", "java", "pt", "pg",
"vox", "amoi", "bird", "compal", "kg", "voda", "sany", "kdd", "dbt",
"sendo", "sgh", "gradi", "jb", "dddi", "moto", "iphone", "android",
"iPod", "incognito", "webmate", "dream", "cupcake", "webos", "s8000",
"bada", "googlebot-mobile")
var ua = navigator.userAgent.toLowerCase();
var isMobile = false;
for ( var i = 0; i < mobiles.length; i++) {
if (ua.indexOf(mobiles[i]) > 0) {
isMobile = true;
break;
}
}
return isMobile;
}
function is_mobile() {
var mobiles = new Array("midp", "j2me", "avant", "docomo", "novarra",
"palmos", "palmsource", "240x320", "opwv", "chtml", "pda",
"windows ce", "mmp/", "blackberry", "mib/", "symbian", "wireless",
"nokia", "hand", "mobi", "phone", "cdm", "up.b", "audio", "sie-",
"sec-", "samsung", "htc", "mot-", "mitsu", "sagem", "sony", "alcatel",
"lg", "eric", "vx", "NEC", "philips", "mmm", "xx", "panasonic",
"sharp", "wap", "sch", "rover", "pocket", "benq", "java", "pt", "pg",
"vox", "amoi", "bird", "compal", "kg", "voda", "sany", "kdd", "dbt",
"sendo", "sgh", "gradi", "jb", "dddi", "moto", "iphone", "android",
"iPod", "incognito", "webmate", "dream", "cupcake", "webos", "s8000",
"bada", "googlebot-mobile")
var ua = navigator.userAgent.toLowerCase();
var isMobile = false;
for ( var i = 0; i < mobiles.length; i++) {
if (ua.indexOf(mobiles[i]) > 0) {
isMobile = true;
break;
}
}
return isMobile;
}
- May 14 Tue 2013 17:10
-
JQ|AJAX設定成同步執行
<script type="text/javascript" src="./js/jquery-1.8.0.js"></script>
<script type="text/javascript" defer>
$(function() {
$.ajax({
url : "js/jquery.tinyscrollbar.min.js",
dataType : "script",
async: false // 先把這隻js執行完後,再跑下面的程式,如果不寫此參數,jQuery預設AJAX為異步執行
});
......其他要執行的程式........
});
</script>
<script type="text/javascript" defer>
$(function() {
$.ajax({
url : "js/jquery.tinyscrollbar.min.js",
dataType : "script",
async: false // 先把這隻js執行完後,再跑下面的程式,如果不寫此參數,jQuery預設AJAX為異步執行
});
......其他要執行的程式........
});
</script>
- May 09 Thu 2013 17:10
-
Facebook like button HTML 5 code not functional in IE 7 / 8
由於IE7.8不接受HTML5
所以要加下面程式讓他支援此程式
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" xmlns:fb="http://ogp.me/ns/fb#">
完整程式:
所以要加下面程式讓他支援此程式
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" xmlns:fb="http://ogp.me/ns/fb#">
完整程式:
- May 02 Thu 2013 14:41
-
MYSQL|如何匯入.csv檔案至MySQL
Import CSV file directly into MySQL:
直接下MYSQL指令 先建立資料表以及欄位,再匯入scv檔案:
load data local infile 'D:/AppServ/www/test/geoip/ip2country/GeoIPCountryWhois.csv' into table tblUserIP fields terminated by ','
enclosed by '"'
lines terminated by '\n'
(uniqName, uniqCity, uniqComments,aname,bname,cname)
直接下MYSQL指令 先建立資料表以及欄位,再匯入scv檔案:
load data local infile 'D:/AppServ/www/test/geoip/ip2country/GeoIPCountryWhois.csv' into table tblUserIP fields terminated by ','
enclosed by '"'
lines terminated by '\n'
(uniqName, uniqCity, uniqComments,aname,bname,cname)
- Apr 24 Wed 2013 10:20
-
Drupal7|寄密碼提醒信給使用者(logintoboggan)
由於系統預設沒有 TOKEN - [user:password]
我們可以藉由安裝下面兩項
達到再設定SHOWPASSWORD RECOVERY信件裡面(/admin/config/people/accounts)
可以抓到使用者原本設定密碼的TOKEN項目
我們可以藉由安裝下面兩項
達到再設定SHOWPASSWORD RECOVERY信件裡面(/admin/config/people/accounts)
可以抓到使用者原本設定密碼的TOKEN項目
- Apr 22 Mon 2013 15:32
-
傳值,切頁(js/post/get)及本頁(ajax)
基本的網頁傳值,以前都換頁用POST/GET居多
但是使用此方法,需要轉頁
通常都會利用一個隱藏的input表單 偷偷利用js來做傳值的動作
程式如下:
<form action='./admin/edit_feature' method='post' id='product_list'>
<input type='hidden' id='product_id' name='product_id' value=''>
但是使用此方法,需要轉頁
通常都會利用一個隱藏的input表單 偷偷利用js來做傳值的動作
程式如下:
<form action='./admin/edit_feature' method='post' id='product_list'>
<input type='hidden' id='product_id' name='product_id' value=''>
- Apr 09 Tue 2013 17:04
-
PHP|Fatal error: Class 'ZipArchive' not found 解決方法
- Mar 27 Wed 2013 12:43
-
CSS|IE8 嵌入iframe有白框邊
現在新版的瀏覽器FF/Chrome/IE9都已經不會有嵌入iframe有白框邊的問題了
唯獨IE8/IE7還是會有
解決方法如下:
<iframe name="container" frameborder="0" allowtransparency="true" id="container" src="{$func_url}" width="100%"
height="auto" marginwidth="100%" marginheight="100%" border="0" scrolling="no" onload="Javascript:SetCwinHeight()">
唯獨IE8/IE7還是會有
解決方法如下:
<iframe name="container" frameborder="0" allowtransparency="true" id="container" src="{$func_url}" width="100%"
height="auto" marginwidth="100%" marginheight="100%" border="0" scrolling="no" onload="Javascript:SetCwinHeight()">
- Mar 20 Wed 2013 13:00
-
JQ|Setting cookies with jQuery
- Mar 15 Fri 2013 12:54
-
YOUTUBE|How to make a YouTube clip look better on your site
<iframe>
Basic
<iframe id="ytplayer" width="460" height="289" src="http://www.youtube.com/embed/fxs970FMYIo" frameborder="0" allowfullscreen></iframe>
Basic
<iframe id="ytplayer" width="460" height="289" src="http://www.youtube.com/embed/fxs970FMYIo" frameborder="0" allowfullscreen></iframe>
- Mar 14 Thu 2013 09:55
-
CSS|HTML5 Doctor CSS Reset
/**
* html5doctor.com Reset Stylesheet v1.6.1 (http://html5doctor.com/html-5-reset-stylesheet/)
* Richard Clark (http://richclarkdesign.com)
* http://cssreset.com
*/
html, body, div, span,object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code,
del, dfn, em, img, ins, kbd, q, samp,
small, strong,sub, sup,var,
b, i,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, figcaption, figure,
footer, header, hgroup, menu, nav, section, summary,
time, mark, audio, video {
margin:0;
padding:0;
border:0;
outline:0;
font-size:100%;
vertical-align:baseline;
background:transparent;
}
body {
line-height:1;
}
article,aside,details,figcaption,figure,
footer,header,hgroup,menu,nav,section {
display:block;
}
nav ul {
list-style:none;
}
blockquote, q {
quotes:none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content:'';
content:none;
}
a {
margin:0;
padding:0;
font-size:100%;
vertical-align:baseline;
background:transparent;
}
/* change colours to suit your needs */
ins {
background-color:#ff9;
color:#000;
text-decoration:none;
}
/* change colours to suit your needs */
mark {
background-color:#ff9;
color:#000;
font-style:italic;
font-weight:bold;
}
del{
text-decoration: line-through;
}
abbr[title], dfn[title]{
border-bottom:1px dotted;
cursor:help;
}
table {
border-collapse:collapse;
border-spacing:0;
}
/* change border colour to suit your needs */
hr {
display:block;
height:1px;
border:0;
border-top:1px solid #cccccc;
margin:1em0;
padding:0;
}
input,select{
vertical-align:middle;
}
* html5doctor.com Reset Stylesheet v1.6.1 (http://html5doctor.com/html-5-reset-stylesheet/)
* Richard Clark (http://richclarkdesign.com)
* http://cssreset.com
*/
html, body, div, span,object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code,
del, dfn, em, img, ins, kbd, q, samp,
small, strong,sub, sup,var,
b, i,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, figcaption, figure,
footer, header, hgroup, menu, nav, section, summary,
time, mark, audio, video {
margin:0;
padding:0;
border:0;
outline:0;
font-size:100%;
vertical-align:baseline;
background:transparent;
}
body {
line-height:1;
}
article,aside,details,figcaption,figure,
footer,header,hgroup,menu,nav,section {
display:block;
}
nav ul {
list-style:none;
}
blockquote, q {
quotes:none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content:'';
content:none;
}
a {
margin:0;
padding:0;
font-size:100%;
vertical-align:baseline;
background:transparent;
}
/* change colours to suit your needs */
ins {
background-color:#ff9;
color:#000;
text-decoration:none;
}
/* change colours to suit your needs */
mark {
background-color:#ff9;
color:#000;
font-style:italic;
font-weight:bold;
}
del{
text-decoration: line-through;
}
abbr[title], dfn[title]{
border-bottom:1px dotted;
cursor:help;
}
table {
border-collapse:collapse;
border-spacing:0;
}
/* change border colour to suit your needs */
hr {
display:block;
height:1px;
border:0;
border-top:1px solid #cccccc;
margin:1em0;
padding:0;
}
input,select{
vertical-align:middle;
}