CSS 選擇器,模糊查找匹配元素

CSS選擇器中沒有所謂的「萬用字元(*)」,可以透過一些方式接近模糊查詢方式,查找匹配屬性或值的元素

歸納出幾種用法

下表屬性名稱不一定為Class,可以替換成需要的屬性
單引號可有可無

[class]比對元素包含指定屬性[id][class][href] 比對元素包含其中一個屬性[class=’test’] 完全比對元素屬性與值 (區分大小寫)[class^=’test’]比對元素屬性開頭為指定的值[class$=’test’] 比對元素屬性結尾為指定的值 [class*=’test’] 模糊比對屬性包含指定的值

使用範例:

See the Pen
CSS 選擇器,模糊查找匹配元素
by VECTOR.cool (@ann71727)
on CodePen.

[……]

閱讀更多

PHP 解決 Fatal error: Uncaught Error: Call to undefined function set_magic_quotes_runtime()

set_magic_quotes_runtime()於 PHP5.3後棄用

在 PHP.net 官方文件中有提到,set_magic_quotes_runtime()於PHP5.3已經棄用,雖然不會造成Fatal error而中斷程式,但會發送E_DEPRECATED的過時警告,而在PHP4.0+已被棄用,所以PHP4.0之後不會有set_magic_quotes_runtime()這function,所以會跳出下列錯誤:

Call to undefined function set_magic_quotes_runtime()

官方說明:
http://php.net/manual/en/function.set-magic-quotes-runtime.php

解決方法:

移除所有 set_magic_quotes_runtime() 程式碼。

替代方案:

[……]

閱讀更多

jQuery Form data to Object

jQuery Serialize Object

取得所有表單資料,目前試過唯一能轉多維表單物件的,使用簡單,找到感覺得救了
Form data to Object jQuery

Example:

<form id="contact">
<input name="user[email]" value="jsmith@example.com">
<input name="user[pets][]" type="checkbox" value="cat" checked>
<input name="user[pets][]" type="checkbox" value="dog" checked>
<input name="user[pets][]" type="checkbox" value="bird">
<input type="submit">
</form>
$('form#contact').serializeObject();
//=> {user: {email: "jsmith@example.com", pets: ["cat", "dog"]}}
$('form#contact').serializeJSON();
//=> '{"user":{"email":"jsmith@example.com","pets":["cat","dog"]}}
'

[……]

閱讀更多

[MIS][WIN10] chrome 變大了,解決方案

不知道為什麼今天開啟Chrome不管是工具列介面,都變大了,不僅如此,網頁的呈現也變大了,看一下縮放比例仍維持100%沒錯壓,大約要調到80%,才跟之前的顯示尺寸一樣,查了一下是Chrome更新所致,但,用起來相當不順手,以下提供解決方案,我順利解決。

開始 > Google Chrome (右鍵) > 更多 > 開啟檔案位置

選取 Google Chrome (右鍵) > 內容

目標欄位

例如我的是”C:Program FilesGoogleChromeApplicationchrome.exe”

在後面加上 /high-dpi-support=1 /force-device-scale-factor=1

變這樣”C:Program FilesGoogleChromeApplicationchrome.exe” /high-dpi-support=1 /force-device-scale-factor=1

/前面記得加個空白鍵

重新建其他地方捷徑
選取 Google Chrome (右鍵) > 傳送到 (N) > 桌面 (建立捷徑)
捷徑就會存在桌面了,再來就看你習慣放哪了

我習慣在下方工具列加上捷徑,所以我這麼做
選取 Google Chrome (右鍵) > 釘選到工具列

關閉所有Google Chrome,若不確定是否全關了,就重新啟動電腦
點工具列圖標,開啟,Chrome,賓果~恢復正常

參考資料
https://forum.gamer.com.tw/C.php?bsn=60030&snA=444515&tnum=3
https://tw.answers.yahoo.com/question/index?qid=20140828000016KK08138

[……]

閱讀更多

[NginX] NginX with PHP http 413 Request Entity Too Large error

in NginX nginx.conf

http {
client_max_body_size 300M;
send_timeout 60s;
}

in PHP.ini

post_max_size = 300M
max_input_time = 60

參考
http://stackoverflow.com/questions/4947107/nginx-upload-client-max-body-size-issue[……]

閱讀更多

[PHP] php7 Call to undefined function curl_init() , fix the issue

Move to Windowssystem32 folder:
libssh2.dll, php_curl.dll, ssleay32.dll, libeay32.dll

Move to Apache24bin folder
libssh2.dll

Uncomment extension=php_curl.dll

原文
http://php.net/manual/en/curl.installation.php

# PHP.ini取消註解
extension=php_curl.dll

# 移動PHP目錄中的下列檔案至 C:Windowssystem32中
libssh2.dll, php_curl.dll, ssleay32.dll, libeay32.dll
# 移動PHP目錄中的下列檔案至apachebin中
libssh2.dll

[……]

閱讀更多