常用代码2
发布时间:2018-04-10, 09:51:04 分类:默认分类 | 编辑 off 网址 | 辅助
图集1/16
正文 992字数 3,605,146阅读
后台基本信息
\app\system\admin\templates\web\webset\index.php
Run code
Cut to clipboard
Remote Desktop Connection Manager微软服务器远程连接链接RDCMan
Everything
Notepad++的Function List插件
下载Function List插件
下载之后将FunctionList.dll 拷贝到/plugins,
C:\Program Files (x86)\Notepad++\plugins
Run code
Cut to clipboard
比如我的安装目录为C:\Program Files\Notepad++,拷贝Lua.bmp and C++.flb到/plugins/config目录下。
C:\Program Files (x86)\Notepad++\plugins\Config
Run code
Cut to clipboard
最后拷贝FunctionListRules.xml到%APPDATA%/Notepad++/plugins/config,
C:\Users\Administrator\AppData\Roaming\Notepad++\plugins\config
Run code
Cut to clipboard
(注:要先把notepad++关了,然后替换原来已有的同名文件!如果没有该路径,可以考虑放到/plugins/config目录下,但是我没有成功。)
notepad++常用快捷键
Ctrl-D 复制当前行至下方
Ctrl-Q 添加/删除注释
Ctrl-Shift-Q 区块添加/删除注释
Ctrl-U 转换为小写
Ctrl-Shift-U 转换为大写
Ctrl-B 跳转至配对的括号
Ctrl-Shift-F 文件中搜索
F11 开关全屏显示(显示标签页)
F12 开关全屏显示(不显示标签页)
Ctrl-Tab 文件标签跳转
Run code
Cut to clipboard
Notepad++主程序绿色版
Notepad++环境变量路径配置文件
C:\Users\Administrator\AppData\Roaming\Notepad++\plugins\config
Run code
Cut to clipboard
(支付宝)给作者钱财以资鼓励 (微信)→
有过 24 条评论 »
FunctionListRules.xml拷贝到C:\\Documents and Settings\\Administrator\\Application Data\\Notepad++\\plugins\\config下
jquery清空form表单
//在form表单中添加一个隐藏的reset按钮, <button type="reset" style="display:none;"></button> //然后通过trigger来触发reset按钮 $("button[type='reset']").trigger("click");//触发reset按钮 //通过form表单的dom对象的reset方法来清空 $('form')[0].reset();
NotePad大小写转换
1、小写转换大写
Ctrl + shift + U
2、大写转换小写
Ctrl + U
注册手机号区号国家号码号段国外国籍外国国旗下拉选择国号字段短信验证码老外
<style>.country em,.u-country em{background:url("https://out.img.pan.lizhenqiu.com/FgA8DLh-5SrtzZ-E8XgTlRBqQZR0") no-repeat;width:16px;height:11px;line-height:11px;display:inline-block;margin-right:0.5em;}.u-country a{position:relative;display:block;height:24px;line-height:24px;overflow:hidden;} .flag-AD em{background-position:0 -594px;} .flag-AE em{background-position:0 -2223px;} .flag-AF em{background-position:0 -2311px;} .flag-AG em{background-position:0 -869px;} .flag-AI em{background-position:0 -1980px;} .flag-AL em{background-position:0 -1034px;} .flag-AM em{background-position:0 -176px;} .flag-AN em{background-position:0 -220px;} .flag-AO em{background-position:0 -1947px;} .flag-AR em{background-position:0 -2377px;} .flag-AT em{background-position:0 -1331px;} .flag-AU em{background-position:0 -1716px;} .flag-AW em{background-position:0 -792px;} .flag-AZ em{background-position:0 -1243px;} .flag-BA em{background-position:0 -1584px;} .flag-BB em{background-position:0 -1573px;} .flag-BD em{background-position:0 -1771px;} .flag-BE em{background-position:0 0px;} .flag-BF em{background-position:0 -726px;} .flag-BG em{background-position:0 -2586px;} .flag-BH em{background-position:0 -1496px;} .flag-BI em{background-position:0 -1892px;} .flag-BJ em{background-position:0 -1298px;} .flag-BM em{background-position:0 -1914px;} .flag-BN em{background-position:0 -1683px;} .flag-BO em{background-position:0 -1650px;} .flag-BR em{background-position:0 -770px;} .flag-BS em{background-position:0 -363px;} .flag-BT em{background-position:0 -1848px;} .flag-BW em{background-position:0 -2707px;} .flag-BY em{background-position:0 -1100px;} .flag-BZ em{background-position:0 -484px;} .flag-CA em{background-position:0 -1375px;} .flag-CD em{background-position:0 -1518px;} .flag-CF em{background-position:0 -1837px;} .flag-CG em{background-position:0 -1793px;} .flag-CH em{background-position:0 -1320px;} .flag-CI em{background-position:0 -1661px;} .flag-CK em{background-position:0 -891px;} .flag-CL em{background-position:0 -1342px;} .flag-CM em{background-position:0 -2057px;} .flag-CN em{background-position:0 -825px;} .flag-CO em{background-position:0 -330px;} .flag-CR em{background-position:0 -2090px;} .flag-CU em{background-position:0 -748px;} .flag-CV em{background-position:0 -2652px;} .flag-CY em{background-position:0 -561px;} .flag-CZ em{background-position:0 -2256px;} .flag-DE em{background-position:0 -2509px;} .flag-DJ em{background-position:0 -2101px;} .flag-DK em{background-position:0 -1386px;} .flag-DM em{background-position:0 -2432px;} .flag-DO em{background-position:0 -1529px;} .flag-DZ em{background-position:0 -528px;} .flag-EC em{background-position:0 -1188px;} .flag-EE em{background-position:0 -2410px;} .flag-EG em{background-position:0 -2201px;} .flag-ER em{background-position:0 -715px;} .flag-ES em{background-position:0 -1155px;} .flag-ET em{background-position:0 -2443px;} .flag-FI em{background-position:0 -1903px;} .flag-FJ em{background-position:0 -1859px;} .flag-FO em{background-position:0 -1111px;} .flag-FR em{background-position:0 -1012px;} .flag-GA em{background-position:0 -880px;} .flag-GB em{background-position:0 -55px;} .flag-GD em{background-position:0 -2399px;} .flag-GE em{background-position:0 -858px;} .flag-GF em{background-position:0 -2234px;} .flag-GH em{background-position:0 -2112px;} .flag-GI em{background-position:0 -275px;} .flag-GL em{background-position:0 -1760px;} .flag-GM em{background-position:0 -627px;} .flag-GN em{background-position:0 -2575px;} .flag-GP em{background-position:0 -407px;} .flag-GQ em{background-position:0 -1507px;} .flag-GR em{background-position:0 -165px;} .flag-GT em{background-position:0 -935px;} .flag-GU em{background-position:0 -2366px;} .flag-GW em{background-position:0 -1925px;} .flag-GY em{background-position:0 -803px;} .flag-HK em{background-position:0 -2696px;} .flag-HN em{background-position:0 -2156px;} .flag-HR em{background-position:0 -902px;} .flag-HT em{background-position:0 -319px;} .flag-HU em{background-position:0 -682px;} .flag-ID em{background-position:0 -1958px;} .flag-IE em{background-position:0 -1969px;} .flag-IL em{background-position:0 -341px;} .flag-IN em{background-position:0 -1694px;} .flag-IQ em{background-position:0 -649px;} .flag-IR em{background-position:0 -2013px;} .flag-IS em{background-position:0 -1991px;} .flag-IT em{background-position:0 -143px;} .flag-JE em{background-position:0 -55px;} .flag-JM em{background-position:0 -1727px;} .flag-JO em{background-position:0 -1463px;} .flag-JP em{background-position:0 -429px;} .flag-KE em{background-position:0 -2630px;} .flag-KG em{background-position:0 -1617px;} .flag-KH em{background-position:0 -242px;} .flag-KM em{background-position:0 -1430px;} .flag-KN em{background-position:0 -99px;} .flag-KP em{background-position:0 -1804px;} .flag-KR em{background-position:0 -2245px;} .flag-KW em{background-position:0 -2487px;} .flag-KY em{background-position:0 -308px;} .flag-KZ em{background-position:0 -1210px;} .flag-LA em{background-position:0 -451px;} .flag-LB em{background-position:0 -1254px;} .flag-LC em{background-position:0 -1397px;} .flag-LI em{background-position:0 -979px;} .flag-LK em{background-position:0 -2641px;} .flag-LR em{background-position:0 -2068px;} .flag-LS em{background-position:0 -2190px;} .flag-LT em{background-position:0 -1122px;} .flag-LU em{background-position:0 -1474px;} .flag-LV em{background-position:0 -1936px;} .flag-LY em{background-position:0 -132px;} .flag-MA em{background-position:0 -2333px;} .flag-MC em{background-position:0 -913px;} .flag-MD em{background-position:0 -2685px;} .flag-ME em{background-position:0 -2167px;} .flag-MG em{background-position:0 -1287px;} .flag-MK em{background-position:0 -1353px;} .flag-ML em{background-position:0 -2520px;} .flag-MN em{background-position:0 -2553px;} .flag-MO em{background-position:0 -2597px;} .flag-MQ em{background-position:0 -198px;} .flag-MR em{background-position:0 -253px;} .flag-MS em{background-position:0 -583px;} .flag-MT em{background-position:0 -1551px;} .flag-MU em{background-position:0 -2179px;} .flag-MV em{background-position:0 -616px;} .flag-MW em{background-position:0 -2145px;} .flag-MX em{background-position:0 -2024px;} .flag-MY em{background-position:0 -1870px;} .flag-MZ em{background-position:0 -638px;} .flag-NA em{background-position:0 -1881px;} .flag-NC em{background-position:0 -1276px;} .flag-NE em{background-position:0 -550px;} .flag-NG em{background-position:0 -2476px;} .flag-NI em{background-position:0 -154px;} .flag-NL em{background-position:0 -1441px;} .flag-NO em{background-position:0 -836px;} .flag-NP em{background-position:0 -110px;} .flag-NZ em{background-position:0 -1540px;} .flag-OM em{background-position:0 -2454px;} .flag-PA em{background-position:0 -847px;} .flag-PE em{background-position:0 -946px;} .flag-PF em{background-position:0 -1705px;} .flag-PG em{background-position:0 -1485px;} .flag-PH em{background-position:0 -1815px;} .flag-PK em{background-position:0 -2035px;} .flag-PL em{background-position:0 -1177px;} .flag-PM em{background-position:0 -1078px;} .flag-PR em{background-position:0 -473px;} .flag-PS em{background-position:0 -1199px;} .flag-PT em{background-position:0 -517px;} .flag-PY em{background-position:0 -2344px;} .flag-QA em{background-position:0 -462px;} .flag-RE em{background-position:0 -264px;} .flag-RO em{background-position:0 -671px;} .flag-RS em{background-position:0 -2465px;} .flag-RU em{background-position:0 -660px;} .flag-RW em{background-position:0 -2674px;} .flag-SA em{background-position:0 -33px;} .flag-SC em{background-position:0 -1045px;} .flag-SD em{background-position:0 -352px;} .flag-SE em{background-position:0 -385px;} .flag-SG em{background-position:0 -22px;} .flag-SI em{background-position:0 -1221px;} .flag-SK em{background-position:0 -2212px;} .flag-SL em{background-position:0 -737px;} .flag-SM em{background-position:0 -2123px;} .flag-SN em{background-position:0 -2134px;} .flag-SO em{background-position:0 -1364px;} .flag-SR em{background-position:0 -2663px;} .flag-SS em{background-position:0 -2718px;} .flag-ST em{background-position:0 -2388px;} .flag-SV em{background-position:0 -1639px;} .flag-SY em{background-position:0 -1826px;} .flag-SZ em{background-position:0 -2278px;} .flag-TC em{background-position:0 -1309px;} .flag-TD em{background-position:0 -814px;} .flag-TG em{background-position:0 -605px;} .flag-TH em{background-position:0 -957px;} .flag-TJ em{background-position:0 -187px;} .flag-TL em{background-position:0 -418px;} .flag-TM em{background-position:0 -2542px;} .flag-TN em{background-position:0 -539px;} .flag-TO em{background-position:0 -1089px;} .flag-TR em{background-position:0 -1606px;} .flag-TT em{background-position:0 -440px;} .flag-TW em{background-position:0 -506px;} .flag-TZ em{background-position:0 -2289px;} .flag-UA em{background-position:0 -2002px;} .flag-UG em{background-position:0 -1166px;} .flag-US em{background-position:0 -44px;} .flag-UY em{background-position:0 -2608px;} .flag-UZ em{background-position:0 -1001px;} .flag-VC em{background-position:0 -2619px;} .flag-VE em{background-position:0 -1056px;} .flag-VG em{background-position:0 -1408px;} .flag-VN em{background-position:0 -968px;} .flag-VU em{background-position:0 -1265px;} .flag-WS em{background-position:0 -2300px;} .flag-YE em{background-position:0 -1672px;} .flag-ZA em{background-position:0 -2355px;} .flag-ZM em{background-position:0 -1595px;} .flag-ZW em{background-position:0 -2046px;} </style> <div class="j-country u-country"> <a href="javascript:void(0);" class="flag-AL" data-code="+355-"><em> </em>阿尔巴尼亚(Shqipëria) +355</a> <a href="javascript:void(0);" class="flag-DZ" data-code="+213-"><em> </em>阿尔及利亚(الجزائر) +213</a> <a href="javascript:void(0);" class="flag-AF" data-code="+93-"><em> </em>阿富汗(افغانستان) +93</a> <a href="javascript:void(0);" class="flag-AR" data-code="+54-"><em> </em>阿根廷(Argentina) +54</a> <a href="javascript:void(0);" class="flag-AE" data-code="+971-"><em> </em>阿拉伯联合大公国(الإمارات العربيّة المتّحدة) +971</a> <a href="javascript:void(0);" class="flag-AW" data-code="+297-"><em> </em>阿鲁巴(Aruba) +297</a> <a href="javascript:void(0);" class="flag-OM" data-code="+968-"><em> </em>阿曼(عمان) +968</a> <a href="javascript:void(0);" class="flag-AZ" data-code="+994-"><em> </em>阿塞拜疆(Azərbaycan) +994</a> <a href="javascript:void(0);" class="flag-EG" data-code="+20-"><em> </em>埃及(مصر) +20</a> <a href="javascript:void(0);" class="flag-ET" data-code="+251-"><em> </em>埃塞俄比亚(Ityop'iya) +251</a> <a href="javascript:void(0);" class="flag-IE" data-code="+353-"><em> </em>爱尔兰(Ireland) +353</a> <a href="javascript:void(0);" class="flag-EE" data-code="+372-"><em> </em>爱沙尼亚(Eesti) +372</a> <a href="javascript:void(0);" class="flag-AD" data-code="+376-"><em> </em>安道尔(Andorra) +376</a> <a href="javascript:void(0);" class="flag-AO" data-code="+244-"><em> </em>安哥拉(Angola) +244</a> <a href="javascript:void(0);" class="flag-AI" data-code="+1264-"><em> </em>安圭拉(Anguilla) +1264</a> <a href="javascript:void(0);" class="flag-AG" data-code="+1268-"><em> </em>安提瓜和巴布达(Antigua and Barbuda) +1268</a> <a href="javascript:void(0);" class="flag-AT" data-code="+43-"><em> </em>奥地利(Österreich) +43</a> <a href="javascript:void(0);" class="flag-AU" data-code="+61-"><em> </em>澳大利亚(Australia) +61</a> <a href="javascript:void(0);" class="flag-MO" data-code="+853-"><em> </em>澳门地区(Macau) +853</a> <a href="javascript:void(0);" class="flag-BB" data-code="+1246-"><em> </em>巴巴多斯(Barbados) +1246</a> <a href="javascript:void(0);" class="flag-PG" data-code="+675-"><em> </em>巴布亚新几内亚 +675</a> <a href="javascript:void(0);" class="flag-BS" data-code="+1242-"><em> </em>巴哈马(Bahamas) +1242</a> <a href="javascript:void(0);" class="flag-PK" data-code="+92-"><em> </em>巴基斯坦(پاکستان) +92</a> <a href="javascript:void(0);" class="flag-PY" data-code="+595-"><em> </em>巴拉圭(Paraguay) +595</a> <a href="javascript:void(0);" class="flag-PS" data-code="+970-"><em> </em>巴勒斯坦领土(Palestinian Territories) +970</a> <a href="javascript:void(0);" class="flag-BH" data-code="+973-"><em> </em>巴林(البحرين) +973</a> <a href="javascript:void(0);" class="flag-PA" data-code="+507-"><em> </em>巴拿马(Panamá) +507</a> <a href="javascript:void(0);" class="flag-BR" data-code="+55-"><em> </em>巴西(Brasil) +55</a> <a href="javascript:void(0);" class="flag-BY" data-code="+375-"><em> </em>白俄罗斯(Белару́сь) +375</a> <a href="javascript:void(0);" class="flag-BM" data-code="+1441-"><em> </em>百慕大(Bermuda) +1441</a> <a href="javascript:void(0);" class="flag-BG" data-code="+359-"><em> </em>保加利亚(България) +359</a> <a href="javascript:void(0);" class="flag-BJ" data-code="+229-"><em> </em>贝宁(Bénin) +229</a> <a href="javascript:void(0);" class="flag-BE" data-code="+32-"><em> </em>比利时(België) +32</a> <a href="javascript:void(0);" class="flag-IS" data-code="+354-"><em> </em>冰岛(Ísland) +354</a> <a href="javascript:void(0);" class="flag-PR" data-code="+1787-"><em> </em>波多黎各(Puerto Rico) +1787</a> <a href="javascript:void(0);" class="flag-PL" data-code="+48-"><em> </em>波兰 +48</a> <a href="javascript:void(0);" class="flag-BA" data-code="+387-"><em> </em>波斯尼亚和黑塞哥维那(Bosna i Hercegovina) +387</a> <a href="javascript:void(0);" class="flag-BO" data-code="+591-"><em> </em>玻利维亚(Bolivia) +591</a> <a href="javascript:void(0);" class="flag-BZ" data-code="+501-"><em> </em>伯利兹(Belize) +501</a> <a href="javascript:void(0);" class="flag-BW" data-code="+267-"><em> </em>博茨瓦纳(Botswana) +267</a> <a href="javascript:void(0);" class="flag-BT" data-code="+975-"><em> </em>不丹(འབྲུག་ཡུལ་) +975</a> <a href="javascript:void(0);" class="flag-BF" data-code="+226-"><em> </em>布基纳法索(Burkina Faso) +226</a> <a href="javascript:void(0);" class="flag-BI" data-code="+257-"><em> </em>布隆迪(Uburundi) +257</a> <a href="javascript:void(0);" class="flag-KP" data-code="+850-"><em> </em>朝鲜 +850</a> <a href="javascript:void(0);" class="flag-GQ" data-code="+240-"><em> </em>赤道几内亚(Guinea Ecuatorial) +240</a> <a href="javascript:void(0);" class="flag-DK" data-code="+45-"><em> </em>丹麦(Danmark) +45</a> <a href="javascript:void(0);" class="flag-DE" data-code="+49-"><em> </em>德国(Deutschland) +49</a> <a href="javascript:void(0);" class="flag-TL" data-code="+670-"><em> </em>东帝汶 +670</a> <a href="javascript:void(0);" class="flag-TG" data-code="+228-"><em> </em>多哥(Togo) +228</a> <a href="javascript:void(0);" class="flag-DM" data-code="+1767-"><em> </em>多米尼加(Dominica) +1767</a> <a href="javascript:void(0);" class="flag-DO" data-code="+1809-"><em> </em>多明尼加共和国(Dominican Republic) +1809</a> <a href="javascript:void(0);" class="flag-RU" data-code="+7-"><em> </em>俄罗斯(Россия) +7</a> <a href="javascript:void(0);" class="flag-EC" data-code="+593-"><em> </em>厄瓜多尔(Ecuador) +593</a> <a href="javascript:void(0);" class="flag-ER" data-code="+291-"><em> </em>厄立特里亚(Ertra) +291</a> <a href="javascript:void(0);" class="flag-FR" data-code="+33-"><em> </em>法国(France) +33</a> <a href="javascript:void(0);" class="flag-FO" data-code="+298-"><em> </em>法罗群岛(Faroe Islands) +298</a> <a href="javascript:void(0);" class="flag-PF" data-code="+689-"><em> </em>法属波利尼西亚(French Polynesia) +689</a> <a href="javascript:void(0);" class="flag-GF" data-code="+594-"><em> </em>法属圭亚那(French Guiana) +594</a> <a href="javascript:void(0);" class="flag-PH" data-code="+63-"><em> </em>菲律宾 +63</a> <a href="javascript:void(0);" class="flag-FJ" data-code="+679-"><em> </em>斐济(Fiji) +679</a> <a href="javascript:void(0);" class="flag-FI" data-code="+358-"><em> </em>芬兰(Suomi) +358</a> <a href="javascript:void(0);" class="flag-CV" data-code="+238-"><em> </em>佛得角(Cabo Verde) +238</a> <a href="javascript:void(0);" class="flag-GM" data-code="+220-"><em> </em>冈比亚(Gambia) +220</a> <a href="javascript:void(0);" class="flag-CG" data-code="+242-"><em> </em>刚果共和国(Congo [Republic]) +242</a> <a href="javascript:void(0);" class="flag-CD" data-code="+243-"><em> </em>刚果民主共和国(Congo [DRC]) +243</a> <a href="javascript:void(0);" class="flag-CO" data-code="+57-"><em> </em>哥伦比亚(Colombia) +57</a> <a href="javascript:void(0);" class="flag-CR" data-code="+506-"><em> </em>哥斯达黎加(Costa Rica) +506</a> <a href="javascript:void(0);" class="flag-GD" data-code="+1473-"><em> </em>格林纳达(Grenada) +1473</a> <a href="javascript:void(0);" class="flag-GL" data-code="+299-"><em> </em>格陵兰(Greenland) +299</a> <a href="javascript:void(0);" class="flag-GE" data-code="+995-"><em> </em>格鲁吉亚(საქართველო) +995</a> <a href="javascript:void(0);" class="flag-CU" data-code="+53-"><em> </em>古巴(Cuba) +53</a> <a href="javascript:void(0);" class="flag-GP" data-code="+590-"><em> </em>瓜德罗普岛(Guadeloupe) +590</a> <a href="javascript:void(0);" class="flag-GU" data-code="+1671-"><em> </em>关岛(Guam) +1671</a> <a href="javascript:void(0);" class="flag-GY" data-code="+592-"><em> </em>圭亚那(Guyana) +592</a> <a href="javascript:void(0);" class="flag-KZ" data-code="+7-"><em> </em>哈萨克斯坦(Россия) +7</a> <a href="javascript:void(0);" class="flag-HT" data-code="+509-"><em> </em>海地(Haïti) +509</a> <a href="javascript:void(0);" class="flag-KR" data-code="+82-"><em> </em>韩国(한국) +82</a> <a href="javascript:void(0);" class="flag-NL" data-code="+31-"><em> </em>荷兰(Nederland) +31</a> <a href="javascript:void(0);" class="flag-AN" data-code="+599-"><em> </em>荷属安的列斯群岛(Netherlands Antilles) +599</a> <a href="javascript:void(0);" class="flag-ME" data-code="+382-"><em> </em>黑山(Црна Гора) +382</a> <a href="javascript:void(0);" class="flag-HN" data-code="+504-"><em> </em>洪都拉斯(Honduras) +504</a> <a href="javascript:void(0);" class="flag-DJ" data-code="+253-"><em> </em>吉布提(Djibouti) +253</a> <a href="javascript:void(0);" class="flag-KG" data-code="+996-"><em> </em>吉尔吉斯斯坦(Кыргызстан) +996</a> <a href="javascript:void(0);" class="flag-GN" data-code="+224-"><em> </em>几内亚(Guinée) +224</a> <a href="javascript:void(0);" class="flag-GW" data-code="+245-"><em> </em>几内亚比绍 +245</a> <a href="javascript:void(0);" class="flag-CA" data-code="+1-"><em> </em>加拿大(United States) +1</a> <a href="javascript:void(0);" class="flag-GH" data-code="+233-"><em> </em>加纳(Ghana) +233</a> <a href="javascript:void(0);" class="flag-GA" data-code="+241-"><em> </em>加蓬(Gabon) +241</a> <a href="javascript:void(0);" class="flag-KH" data-code="+855-"><em> </em>柬埔寨(Kampuchea) +855</a> <a href="javascript:void(0);" class="flag-CZ" data-code="+420-"><em> </em>捷克共和国(Česko) +420</a> <a href="javascript:void(0);" class="flag-ZW" data-code="+263-"><em> </em>津巴布韦(Zimbabwe) +263</a> <a href="javascript:void(0);" class="flag-CM" data-code="+237-"><em> </em>喀麦隆(Cameroun) +237</a> <a href="javascript:void(0);" class="flag-QA" data-code="+974-"><em> </em>卡塔尔(قطر) +974</a> <a href="javascript:void(0);" class="flag-KY" data-code="+1345-"><em> </em>开曼群岛(Cayman Islands) +1345</a> <a href="javascript:void(0);" class="flag-KM" data-code="+269-"><em> </em>科摩罗(Comoros) +269</a> <a href="javascript:void(0);" class="flag-KW" data-code="+965-"><em> </em>科威特(الكويت) +965</a> <a href="javascript:void(0);" class="flag-HR" data-code="+385-"><em> </em>克罗地亚(Hrvatska) +385</a> <a href="javascript:void(0);" class="flag-KE" data-code="+254-"><em> </em>肯尼亚(Kenya) +254</a> <a href="javascript:void(0);" class="flag-CK" data-code="+682-"><em> </em>库克群岛 +682</a> <a href="javascript:void(0);" class="flag-LV" data-code="+371-"><em> </em>拉脱维亚(Latvija) +371</a> <a href="javascript:void(0);" class="flag-LS" data-code="+266-"><em> </em>莱索托(Lesotho) +266</a> <a href="javascript:void(0);" class="flag-LA" data-code="+856-"><em> </em>老挝(ປະຊາຊົນສປປລາວ) +856</a> <a href="javascript:void(0);" class="flag-LB" data-code="+961-"><em> </em>黎巴嫩(لبنان) +961</a> <a href="javascript:void(0);" class="flag-LT" data-code="+370-"><em> </em>立陶宛(Lietuva) +370</a> <a href="javascript:void(0);" class="flag-LR" data-code="+231-"><em> </em>利比里亚(Liberia) +231</a> <a href="javascript:void(0);" class="flag-LY" data-code="+218-"><em> </em>利比亚(ليبيا) +218</a> <a href="javascript:void(0);" class="flag-LI" data-code="+423-"><em> </em>列支敦士登(Liechtenstein) +423</a> <a href="javascript:void(0);" class="flag-RE" data-code="+262-"><em> </em>留尼旺岛(Réunion) +262</a> <a href="javascript:void(0);" class="flag-LU" data-code="+352-"><em> </em>卢森堡(Lëtzebuerg) +352</a> <a href="javascript:void(0);" class="flag-RW" data-code="+250-"><em> </em>卢旺达(Rwanda) +250</a> <a href="javascript:void(0);" class="flag-RO" data-code="+40-"><em> </em>罗马尼亚(România) +40</a> <a href="javascript:void(0);" class="flag-MG" data-code="+261-"><em> </em>马达加斯加(Madagasikara) +261</a> <a href="javascript:void(0);" class="flag-MV" data-code="+960-"><em> </em>马尔代夫(ގުޖޭއްރާ ޔާއްރިހޫމްޖ) +960</a> <a href="javascript:void(0);" class="flag-MT" data-code="+356-"><em> </em>马耳他(Malta) +356</a> <a href="javascript:void(0);" class="flag-MW" data-code="+265-"><em> </em>马拉维(Malawi) +265</a> <a href="javascript:void(0);" class="flag-MY" data-code="+60-"><em> </em>马来西亚(Malaysia) +60</a> <a href="javascript:void(0);" class="flag-ML" data-code="+223-"><em> </em>马里(Mali) +223</a> <a href="javascript:void(0);" class="flag-MK" data-code="+389-"><em> </em>马其顿(Македонија) +389</a> <a href="javascript:void(0);" class="flag-MQ" data-code="+596-"><em> </em>马提尼克(Martinique) +596</a> <a href="javascript:void(0);" class="flag-MU" data-code="+230-"><em> </em>毛里求斯(Mauritius) +230</a> <a href="javascript:void(0);" class="flag-MR" data-code="+222-"><em> </em>毛里塔尼亚(موريتانيا) +222</a> <a href="javascript:void(0);" class="flag-US" data-code="+1-"><em> </em>美国(United States) +1</a> <a href="javascript:void(0);" class="flag-MN" data-code="+976-"><em> </em>蒙古(Монгол Улс) +976</a> <a href="javascript:void(0);" class="flag-MS" data-code="+1664-"><em> </em>蒙特塞拉特(Montserrat) +1664</a> <a href="javascript:void(0);" class="flag-BD" data-code="+880-"><em> </em>孟加拉国(বাংলাদেশ) +880</a> <a href="javascript:void(0);" class="flag-PE" data-code="+51-"><em> </em>秘鲁(Perú) +51</a> <a href="javascript:void(0);" class="flag-MD" data-code="+373-"><em> </em>摩尔多瓦(Moldova) +373</a> <a href="javascript:void(0);" class="flag-MA" data-code="+212-"><em> </em>摩洛哥(المغرب) +212</a> <a href="javascript:void(0);" class="flag-MC" data-code="+377-"><em> </em>摩纳哥(Monaco) +377</a> <a href="javascript:void(0);" class="flag-MZ" data-code="+258-"><em> </em>莫桑比克(Moçambique) +258</a> <a href="javascript:void(0);" class="flag-MX" data-code="+52-"><em> </em>墨西哥(México) +52</a> <a href="javascript:void(0);" class="flag-NA" data-code="+264-"><em> </em>纳米比亚(Namibia) +264</a> <a href="javascript:void(0);" class="flag-ZA" data-code="+27-"><em> </em>南非(South Africa) +27</a> <a href="javascript:void(0);" class="flag-SS" data-code="+211-"><em> </em>南苏丹 +211</a> <a href="javascript:void(0);" class="flag-NP" data-code="+977-"><em> </em>尼泊尔(नेपाल) +977</a> <a href="javascript:void(0);" class="flag-NI" data-code="+505-"><em> </em>尼加拉瓜(Nicaragua) +505</a> <a href="javascript:void(0);" class="flag-NE" data-code="+227-"><em> </em>尼日尔(Niger) +227</a> <a href="javascript:void(0);" class="flag-NG" data-code="+234-"><em> </em>尼日利亚(Nigeria) +234</a> <a href="javascript:void(0);" class="flag-NO" data-code="+47-"><em> </em>挪威(Norge) +47</a> <a href="javascript:void(0);" class="flag-PT" data-code="+351-"><em> </em>葡萄牙(Portugal) +351</a> <a href="javascript:void(0);" class="flag-JP" data-code="+81-"><em> </em>日本(にっぽんこく,にほんこく) +81</a> <a href="javascript:void(0);" class="flag-SE" data-code="+46-"><em> </em>瑞典(Sverige) +46</a> <a href="javascript:void(0);" class="flag-CH" data-code="+41-"><em> </em>瑞士(Schweiz) +41</a> <a href="javascript:void(0);" class="flag-SV" data-code="+503-"><em> </em>萨尔瓦多(El Salvador) +503</a> <a href="javascript:void(0);" class="flag-WS" data-code="+685-"><em> </em>萨摩亚(Samoa) +685</a> <a href="javascript:void(0);" class="flag-RS" data-code="+381-"><em> </em>塞尔维亚(Србија) +381</a> <a href="javascript:void(0);" class="flag-SL" data-code="+232-"><em> </em>塞拉利昂(Sierra Leone) +232</a> <a href="javascript:void(0);" class="flag-SN" data-code="+221-"><em> </em>塞内加尔(Sénégal) +221</a> <a href="javascript:void(0);" class="flag-CY" data-code="+357-"><em> </em>塞浦路斯(Κυπρος) +357</a> <a href="javascript:void(0);" class="flag-SC" data-code="+248-"><em> </em>塞舌尔(Seychelles) +248</a> <a href="javascript:void(0);" class="flag-SA" data-code="+966-"><em> </em>沙特阿拉伯(المملكة العربية السعودية) +966</a> <a href="javascript:void(0);" class="flag-ST" data-code="+239-"><em> </em>圣多美和普林西比 +239</a> <a href="javascript:void(0);" class="flag-KN" data-code="+1869-"><em> </em>圣基茨和尼维斯(Saint Kitts and Nevis) +1869</a> <a href="javascript:void(0);" class="flag-LC" data-code="+1758-"><em> </em>圣卢西亚(Saint Lucia) +1758</a> <a href="javascript:void(0);" class="flag-SM" data-code="+378-"><em> </em>圣马力诺(San Marino) +378</a> <a href="javascript:void(0);" class="flag-PM" data-code="+508-"><em> </em>圣皮埃尔和密克隆群岛(Saint Pierre and Miquelon) +508</a> <a href="javascript:void(0);" class="flag-VC" data-code="+1784-"><em> </em>圣文森特和格林纳丁斯(Saint Vincent and the Grenadines) +1784</a> <a href="javascript:void(0);" class="flag-LK" data-code="+94-"><em> </em>斯里兰卡(Sri Lanka) +94</a> <a href="javascript:void(0);" class="flag-SK" data-code="+421-"><em> </em>斯洛伐克(Slovensko) +421</a> <a href="javascript:void(0);" class="flag-SI" data-code="+386-"><em> </em>斯洛文尼亚(Slovenija) +386</a> <a href="javascript:void(0);" class="flag-SZ" data-code="+268-"><em> </em>斯威士兰(Swaziland) +268</a> <a href="javascript:void(0);" class="flag-SD" data-code="+249-"><em> </em>苏丹(السودان) +249</a> <a href="javascript:void(0);" class="flag-SR" data-code="+597-"><em> </em>苏里南(Suriname) +597</a> <a href="javascript:void(0);" class="flag-SO" data-code="+252-"><em> </em>索马里(Soomaaliya) +252</a> <a href="javascript:void(0);" class="flag-TJ" data-code="+992-"><em> </em>塔吉克斯坦(Тоҷикистон) +992</a> <a href="javascript:void(0);" class="flag-TW" data-code="+886-"><em> </em>台湾地区(台灣) +886</a> <a href="javascript:void(0);" class="flag-TH" data-code="+66-"><em> </em>泰国(ราชอาณาจักรไทย) +66</a> <a href="javascript:void(0);" class="flag-TZ" data-code="+255-"><em> </em>坦桑尼亚(Tanzania) +255</a> <a href="javascript:void(0);" class="flag-TO" data-code="+676-"><em> </em>汤加(Tonga) +676</a> <a href="javascript:void(0);" class="flag-TC" data-code="+1649-"><em> </em>特克斯和凯科斯群岛(Turks and Caicos Islands) +1649</a> <a href="javascript:void(0);" class="flag-TT" data-code="+1868-"><em> </em>特里尼达和多巴哥(Trinidad and Tobago) +1868</a> <a href="javascript:void(0);" class="flag-TN" data-code="+216-"><em> </em>突尼斯(تونس) +216</a> <a href="javascript:void(0);" class="flag-TR" data-code="+90-"><em> </em>土耳其(Türkiye) +90</a> <a href="javascript:void(0);" class="flag-TM" data-code="+993-"><em> </em>土库曼斯坦(Türkmenistan) +993</a> <a href="javascript:void(0);" class="flag-VU" data-code="+678-"><em> </em>瓦努阿图(Vanuatu) +678</a> <a href="javascript:void(0);" class="flag-GT" data-code="+502-"><em> </em>危地马拉(Guatemala) +502</a> <a href="javascript:void(0);" class="flag-VE" data-code="+58-"><em> </em>委内瑞拉(Venezuela) +58</a> <a href="javascript:void(0);" class="flag-BN" data-code="+673-"><em> </em>文莱(Brunei Darussalam) +673</a> <a href="javascript:void(0);" class="flag-UG" data-code="+256-"><em> </em>乌干达(Uganda) +256</a> <a href="javascript:void(0);" class="flag-UA" data-code="+380-"><em> </em>乌克兰(Україна) +380</a> <a href="javascript:void(0);" class="flag-UY" data-code="+598-"><em> </em>乌拉圭(Uruguay) +598</a> <a href="javascript:void(0);" class="flag-UZ" data-code="+998-"><em> </em>乌兹别克斯坦(O'zbekiston) +998</a> <a href="javascript:void(0);" class="flag-ES" data-code="+34-"><em> </em>西班牙(España) +34</a> <a href="javascript:void(0);" class="flag-GR" data-code="+30-"><em> </em>希腊(Ελλάς) +30</a> <a href="javascript:void(0);" class="flag-HK" data-code="+852-"><em> </em>香港地区(Hong Kong) +852</a> <a href="javascript:void(0);" class="flag-CI" data-code="+225-"><em> </em>象牙海岸(Côte d'Ivoire) +225</a> <a href="javascript:void(0);" class="flag-SG" data-code="+65-"><em> </em>新加坡(Singapura) +65</a> <a href="javascript:void(0);" class="flag-NC" data-code="+687-"><em> </em>新喀里多尼亚(New Caledonia) +687</a> <a href="javascript:void(0);" class="flag-NZ" data-code="+64-"><em> </em>新西兰(New Zealand) +64</a> <a href="javascript:void(0);" class="flag-HU" data-code="+36-"><em> </em>匈牙利(Magyarország) +36</a> <a href="javascript:void(0);" class="flag-SY" data-code="+963-"><em> </em>叙利亚(سوريا) +963</a> <a href="javascript:void(0);" class="flag-JM" data-code="+1876-"><em> </em>牙买加(Jamaica) +1876</a> <a href="javascript:void(0);" class="flag-AM" data-code="+374-"><em> </em>亚美尼亚(Հայաստան) +374</a> <a href="javascript:void(0);" class="flag-YE" data-code="+967-"><em> </em>也门(اليمن) +967</a> <a href="javascript:void(0);" class="flag-IQ" data-code="+964-"><em> </em>伊拉克(العراق) +964</a> <a href="javascript:void(0);" class="flag-IR" data-code="+98-"><em> </em>伊朗(ایران) +98</a> <a href="javascript:void(0);" class="flag-IL" data-code="+972-"><em> </em>以色列(ישראל) +972</a> <a href="javascript:void(0);" class="flag-IT" data-code="+39-"><em> </em>意大利(Italia) +39</a> <a href="javascript:void(0);" class="flag-IN" data-code="+91-"><em> </em>印度(India) +91</a> <a href="javascript:void(0);" class="flag-ID" data-code="+62-"><em> </em>印尼(Indonesia) +62</a> <a href="javascript:void(0);" class="flag-GB" data-code="+44-"><em> </em>英国(United Kingdom) +44</a> <a href="javascript:void(0);" class="flag-VG" data-code="+1340-"><em> </em>英属维尔京群岛(U.S. Virgin Islands) +1340</a> <a href="javascript:void(0);" class="flag-JO" data-code="+962-"><em> </em>约旦(الاردن) +962</a> <a href="javascript:void(0);" class="flag-VN" data-code="+84-"><em> </em>越南(Việt Nam) +84</a> <a href="javascript:void(0);" class="flag-ZM" data-code="+260-"><em> </em>赞比亚(Zambia) +260</a> <a href="javascript:void(0);" class="flag-JE" data-code="+44-"><em> </em>泽西岛(United Kingdom) +44</a> <a href="javascript:void(0);" class="flag-TD" data-code="+235-"><em> </em>乍得(Tchad) +235</a> <a href="javascript:void(0);" class="flag-GI" data-code="+350-"><em> </em>直布罗陀(Gibraltar) +350</a> <a href="javascript:void(0);" class="flag-CL" data-code="+56-"><em> </em>智利(Chile) +56</a> <a href="javascript:void(0);" class="flag-CF" data-code="+236-"><em> </em>中非共和国(République Centrafricaine) +236</a> </div>
\app\system\admin\templates\web\content
\app\system\include\public\js\examples\editor\ueditor\ueditor.config.js
\app\system\include\public\js\examples\editor\ueditor\dialogs\insertframe\insertframe.html
php接收textarea内容后显示换行和空格
php textarea换行
str_replace(" "," ",str_replace("\n","<br/>",$_POST['content']));
也可以使用nl2br进行回车替换
echo nl2br($_POST['content']); //nl2br() 函数在字符串中的每个新行 (\n) 之前插入 HTML 换行符 (<br />)
注:要用双引号,不然无法替换;
编辑器改变获取内容
window.UE.getEditor('container_contentcarinfo').setContent(data);
dataType: 'json', error: function(request) { /*$.edbox({ html:'<div class="example-html">服务器繁忙</div>', ////animateOpen:'animated tada', ////animateClose:'animated flipOutX', afterClose:function(){ location.reload(); } });*/ alert('服务器繁忙'); return false; //alert("提交失败"); }, success: function(data) { if(data){ //$('#ajax_get_cx').html(data); //return false; var css=''; window.UE.getEditor('container_contentcarinfo').setContent(css+data.info); }else{
ueditor 去掉默认<p>
// 找到addInputRule方法,并将switch case 中的case style:删除 me.addInputRule(function (root) { ... //进行默认的处理 root.traversal(function (node) { if (node.type == 'element') { ... switch (node.tagName) { case 'style': // 删除这项 case 'script': .... } } } })
js name textarea 赋值
$("[name='content']").html(值); $("[name='content']").text(值);
phpjson字符串转json对象
<?php $json = '{"a":1,"b":2,"c":3,"d":4,"e":5}'; var_dump(json_decode($json)); var_dump(json_decode($json, true));
结果
object(stdClass)#1 (5) { ["a"] => int(1) ["b"] => int(2) ["c"] => int(3) ["d"] => int(4) ["e"] => int(5) } array(5) { ["a"] => int(1) ["b"] => int(2) ["c"] => int(3) ["d"] => int(4) ["e"] => int(5) }
如果你json_decode后返回null,你是不是把字符串写成这样了"{ 'bar': 'baz' }",这个在JS里是可以正常解析成JSON的,但是PHP里面要写成'{ "bar": "baz" }',属性和值要用双引号
PHP中用foreach()循环中,想要在循环的时候,当满足某个条件时,想要跳出本次循环继续执行下次循环,或者满足某个条件的时候,终止foreach()循环,分别会用到:continue 与 break
$arr= array('le','yang','jun','lecode','gagade'); $html= ''; foreach($arras $key => $value){ if($value=='b'){ $html.= $value; continue;// 当 $value为b时,跳出本次循环 } if($value=='c'){ $html.= $value; break;// 当 $value为c时,终止循环 } $html.= $value; } echo$html; // 输出: abc
<script type="text/javascript"> $(document).ready(function () { $("#sel").bind("change",function(){ if($(this).val()==0){ return; } else{ $("#thediv").text($(this).val()); } }); }); </script>
Cookie设置
cookie('name','value'); //设置cookie cookie('name','value',3600); // 指定cookie保存时间
3.1版本开始,cookie方法增加对数组的支持(采用轻量级的json编码格式保存 减少存储空间)
cookie('name',array('name1','name2'));
还可以支持参数传入的方式完成复杂的cookie赋值,下面是对cookie的值设置3600秒有效期,并且加上cookie前缀think_
cookie('name','value',array('expire'=>3600,'prefix'=>'think_'))
数组参数可以采用query形式参数
cookie('name','value','expire=3600&prefix=think_')
和上面的用法等效。
传入的option参数支持prefix,expire,path,domain四个索引参数,如果没有传入或者传入空值的话,会默认取COOKIE_PREFIX、COOKIE_EXPIRE、COOKIE_PATH和COOKIE_DOMAIN四个配置参数。如果只传入个别参数,那么也会和默认的配置参数合并
Cookie获取
获取cookie很简单,无论是怎么设置的cookie,只需要使用:
$value = cookie('name');
如果没有设置cookie前缀的话 相当于
$value = $_COOKIE['前缀+name']
Cookie删除
删除某个cookie的值,使用:
cookie('name',null);
要删除所有的Cookie值,可以使用
cookie(null); // 清空当前设定前缀的所有cookie值 cookie(null,'think_'); // 清空指定前缀的所有cookie值
第一种方式:
var oMyForm = new FormData(); oMyForm.append("username", "Groucho"); oMyForm.append("accountnum", 123456); oMyForm.append("file", $('#file')[0].files[0]); $.ajax({ url: '/Manage/UploadImg', type: 'POST', cache: false, data: oMyForm, processData: false, contentType: false, async: false }).done(function(res) {}).fail(function(res) {});
第二种方式:
<form id="uploadForm" enctype="multipart/form-data"> <p>指定文件名: <input type="text" name="filename" value="" /></p> <p>上传文件: <input type="file" name="file" /></ p> <input type="button" value="上传" onclick="doUpload()" /> </form>
var formData = new FormData($('#uploadForm')[0]); formData.append('num', '1');//可以在已有表单数据的基础上,继续添加新的键值对 $.ajax({ url: '/upload', type: 'POST', cache: false, data: new FormData($('#uploadForm')[0]), processData: false, contentType: false }).done(function(res) {}).fail(function(res) {});
注意:
Ajax的processData设置为false。因为data值是FormData对象,不需要对数据做处理。
第二种方式中<form>标签加enctyp e="multipart/form-data"属性。
cache设置为false,上传文件不需要缓存。
contentType设置为false。因为是由<form>表单构造的FormData对象,且已经声明了属性enctype="mutipart/form-data",所以这里设置为false
$("#id")与$('input[name="nameId"]')的区别 今日在用easyUI的numberbox控件时遇到一个问题; 我在页面中定义了一个输入框: <input id="yesId" name="yesName" value="yes" ></input> 使用jquery选择器获取这个输入框时,有两种方法 var a = $("#yesId"); var b = $('input[name="yesName"]'); alert(a == b); // false 总结:在使用numberbox的setValue方法时: $("#yesId").numberbox("setValue",100); // 有效,这也是api上使用的方式 $('input[name="yesName"]').numberbox("setValue",100); // 无效并报错,不可使用此方式
for($i=65;$i<91;$i++){ echo strtolower(chr($i)).' ';//输出小写字母 echo strtoupper(chr($i)).' ';//输出大写字母 }
jquery获取select选中的值 误区: 一直以为jquery获取select中option被选中的文本值,是这样写的: $("#s").text(); //获取所有option的文本值 实际上应该这样: $("#s option:selected").text(); //获取选中的option的文本值 获取select中option的被选中的value值, $("#s").val(); $("#s option:selected").val(); js获取select选中的值: var sel=document.getElementById("select1"); var index = sel.selectedIndex; // 选中索引 albumid= sel.options[index].value;//要的值
jquery操作select(取值,设置选中)(转) http://www.cnblogs.com/liaojie970/p/5210541.html 比如<select class="selector"></select> 1、设置value为pxx的项选中 $(".selector").val("pxx"); 2、设置text为pxx的项选中 $(".selector").find("option[text='pxx']").attr("selected",true); 这里有一个中括号的用法,中括号里的等号的前面是属性名称,不用加引号。很多时候,中括号的运用可以使得逻辑变得很简单。 3、获取当前选中项的value $(".selector").val(); 4、获取当前选中项的text $(".selector").find("option:selected").text(); 这里用到了冒号,掌握它的用法并举一反三也会让代码变得简洁。 很多时候用到select的级联,即第二个select的值随着第一个select选中的值变化。这在jquery中是非常简单的。 如:$(".selector1").change(function(){ // 先清空第二个 $(".selector2").empty(); // 实际的应用中,这里的option一般都是用循环生成多个了 var option = $("<option>").val(1).text("pxx"); $(".selector2").append(option); });
ueditor.all.js
// 找到allowDivTransToP参数,这个参数会将DIV标签转为P标签,设置为false me.setOpt( { 'allowDivTransToP':false, 'disabledTableInTable':true } );
weiphp ueditor
\Public\static\ueditor
thinkphp 过滤style
weiphp
// 系统默认的变量过滤机制 'DEFAULT_FILTER' => 'htmlspecialchars'
\Application\Common\Conf\config.php
\Application\Common\Common\function.php
百度编辑器修图添加css和style标签样式ueditor.all.min.js
百度编辑器修图添加css和style标签样式ueditor.all.min.js
百度编辑器修图添加css和style标签样式ueditor.all.min.js
tp框架中有个接受所有post过来的函数
Model的create()方法,自动创建数据对象功能
//获取服务保障文章 $fwbzlist=M('news')->order('no_order desc,id desc')->limit(9)->select();//where("class1=482")-> //dump($fwbzlist);exit; foreach($fwbzlist as $fwk=>&$fwv){ $fwv= str_replace("\r\n",'<br/>',$fwv); } $this->assign('fwbzlist',$fwbzlist);
PHP正则去掉img 宽度高度
<?php //去掉图片宽度 $search = '/(<img.*?)width=(["\'])?.*?(?(2)\2|\s)([^>]+>)/is'; $content = preg_replace($search,'$1$3',$content); //去除图片的高度 $search1 = '/(<img.*?)height=(["\'])?.*?(?(2)\2|\s)([^>]+>)/is'; $content = preg_replace($search1,'$1$3',$content); //去除style样式 $content = preg_replace("/style=.+?['|\"]/i",'',$content); ?> <style>.centent img{max-width:100%;}</style>
放在body后面
移动设备移动端手机版本 rem
页面加载顺序 font-size:0px 闪缩 适配
<script> document.ready = function(){ /*360代表设计师给的设计稿的宽度,你的设计稿是多少,就写多少;100代表换算比例,这里写100是 为了以后好算,比如,你测量的一个宽度是100px,就可以写为1rem,以及1px=0.01rem等等*/ getRem(360,100) }; window.onresize = function(){ getRem(360,100) }; getRem(360,100); function getRem(pwidth,prem){ var html = document.getElementsByTagName("html")[0]; var oWidth = document.body.clientWidth || document.documentElement.clientWidth; html.style.fontSize = oWidth/pwidth*prem + "px"; } </script><!--100px=1rem-->
window.onload = function () { alert('onload'); }; document.ready(function () { alert('ready'); });
$(function(){}) 和$(document).ready(function(){})
document.ready = function (callback) { ///兼容FF,Google if (document.addEventListener) { document.addEventListener('DOMContentLoaded', function () { document.removeEventListener('DOMContentLoaded', arguments.callee, false); callback(); }, false) } //兼容IE else if (document.attachEvent) { document.attachEvent('onreadystatechange', function () { if (document.readyState == "complete") { document.detachEvent("onreadystatechange", arguments.callee); callback(); } }) } else if (document.lastChild == document.body) { callback(); } }
html代码空格影响
HTML中的换行造成空格问题
html的标签之间带不带空格或换行, 对样式有影响
html代码换行造成空格间距问题
html中连续多个空格或者多行空行的影响
HTML中的换行造成空格问题 html的标签之间的空白字符不被解析
给父元素设置字体大小为0,
对于html内置的内联级标签以及表单元素标签,源代码中连续几个内联级标签中的换行在浏览器中会被解释为一个空格。
包括ie和ff。而这个空格是会被当作一个空白节点(nodeType等于3的节点,就是文字节点)。
对于html内置的块级标签使用了display:inline;则没上述问题。
对于html内置的块级标签之间的换行,ff会当作一个空白节点(用js可以获取到),ie则会忽略掉这个换行。
这个换行在ie和ff的页面上并无任何影响,不会出现空格。
<!DOCTYPE html> <html> <head> <title>网站标题</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <meta name="keywords" content="网站关键词"> <meta name="description" content="网站描述"> <!--初始化--><style> *{padding:0px;margin:0px;font-family: 微软雅黑, "Microsoft yahei", "Hiragino Sans GB", "冬青黑体简体中文 w3", "Microsoft Yahei", "Hiragino Sans GB", "冬青黑体简体中文 w3", STXihei, 华文细黑, SimSun, 宋体, Heiti, 黑体, sans-serif, Arial;} img{display:block;max-width:100%;} html,body{min-height:100%;} /*利用:after伪元素*/ .clearUl:after { content:""; display: block; clear: both; } /*去掉iPhone按钮样式 蓝色边框*/ input,textarea{outline:none;-webkit-appearance: none;} </style> <script> //重写alert方法,去掉地址显示 window.alert = function(name){ var iframe = document.createElement("IFRAME"); iframe.style.display="none"; iframe.setAttribute("src", 'data:text/plain,'); document.documentElement.appendChild(iframe); window.frames[0].window.alert(name); iframe.parentNode.removeChild(iframe); } //重写confirm方法,去掉地址显示 window.confirm = function(name){ var iframe = document.createElement("IFRAME"); iframe.style.display="none"; iframe.setAttribute("src", 'data:text/plain,'); document.documentElement.appendChild(iframe); var result = window.frames[0].window.confirm(name); iframe.parentNode.removeChild(iframe); return result; } </script><!--end--> </head> <body> </body> </html>
图片已删除 图片已经删除 图片不存在 图片错误 404
个人常用的一些方法记录 /** * 返回错误 * * @param int $err_no * @param string $err_msg * @param array $data * @return array */ function returnError($err_no = 0, $err_msg = '', $data = []) { // 错误配置 $config = config('error'); // 错误信息 $error = [ 'err_no' => $err_no, 'err_msg' => empty($err_msg) ? $config[$err_no] : $err_msg, 'data' => $data ]; // 返回 return $error; } /** * 错误响应 * * @param int $err_no * @param string $err_msg * @param array $data * @param string $jsonp * @return \Illuminate\Http\Response */ function response($err_no = 0, $err_msg = '', $data = [], $jsonp = '') { // 错误配置 $config = config('error'); // 错误信息 $error = [ 'err_no' => $err_no, 'err_msg' => empty($err_msg) ? $config[$err_no] : $err_msg, 'data' => $data ]; // 格式化 $result = response()->json($error); empty($jsonp) || $result->setCallback($jsonp); // 返回 return $result; } /** * CURL * * @param string $url * @param string $type * [GET|POST] * @param array|string $data * @param array $header * @return bool|string */ function curlRequest($url = '', $type = 'GET', $data = '', $header = []) { // 参数校验 if (empty($url) || ! in_array(strtoupper($type), [ 'GET', 'POST', 'PUT', 'DELETE' ])) { return false; } // 初始化 $ch = curl_init(); if (! $ch) { return false; } // 请求参数 $data = is_array($data) ? http_build_query($data) : $data; // 请求方式 if (strtoupper($type) == 'POST') { curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); } if (strtoupper($type) == 'GET') { empty($data) || $url .= '?' . $data; } if (strtoupper($type) == 'PUT') { curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); } if (strtoupper($type) == 'DELETE') { curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); } // 通用配置 curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); // 头信息 if (! empty($header)) { curl_setopt($ch, CURLOPT_HTTPHEADER, $header); } // 执行请求 $result = curl_exec($ch); // 错误信息 // $err_no = curl_errno($ch); // $err_info = curl_getinfo($ch); // 关闭资源 curl_close($ch); // 返回 return $result; } /** * 数组转XML[解析:simplexml_load_string($param, 'SimpleXMLElement', LIBXML_NOCDATA)] * * @param array $param * @return string */ function convertXml($param = []) { // 初始化 $xml = ''; // 循环 foreach ($param as $k => $v) { $xml .= "<{$k}><![CDATA[{$v}]]></{$k}>"; } // 返回 return sprintf('<xml>%s</xml>', $xml); } /** * 写入日志|自定义文件 * * @param string $file * @param array $logs * @return bool */ function debug($file = 'debug', $logs = [], $code = 'Debug') { // 文件路径 $path = storage_path("logs/{$file}.log"); // 日志内容 $data = sprintf('[%s] %s %s%s', date('Y-m-d H:i:s'), $code, json_encode($logs, 320), PHP_EOL); // 写入日志 $result = file_put_contents($path, $data, FILE_APPEND); // 返回 return $result === false ? false : true; } /** * 导出CSV * * @param string $filename * @param string $data */ function exportCsv($filename = '', $data = array()) { header("Content-type:text/csv"); header("Content-Disposition:attachment;filename={$filename}.csv"); header('Cache-Control:must-revalidate,post-check=0,pre-check=0'); header('Expires:0'); header('Pragma:public'); $output = ''; foreach ($data as $v) { foreach ($v as $v2) { $output .= mb_convert_encoding($v2, 'GBK', 'UTF-8') . ','; } $output .= "\n"; } exit($output); } /** * 获取当前URL * * @return string */ function getCurrUrl() { $sys_protocal = isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443' ? 'https://' : 'http://'; $php_self = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']; $path_info = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : ''; $relate_url = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $php_self . (isset($_SERVER['QUERY_STRING']) ? '?' . $_SERVER['QUERY_STRING'] : $path_info); $curr_url = $sys_protocal . (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '') . $relate_url; return urlencode($curr_url); } /** * 生成唯一ID * * @return string */ function uniqueId() { // 时间+随机数 return sprintf('%s%04s', date('YmdHis'), mt_rand(0, 9999)); } /** * 根据字典名称获取数据字典 * * @param string $name * @return mixed */ function getConf($name = '', $site_id = 0) { if (empty($name)) { return false; } $data = DB::table('dictionary')->where('site_id', $site_id) ->where('name', strtolower($name)) ->first(); if ($data) { // 单值模式 if ($data['type_id'] == 1) { return json_decode($data['value'], true); } elseif ($data['type_id'] == 2) { // 查询字典列表 $list = DB::table('dictionary_list')->select([ 'key_name', 'key_value' ]) ->where('dictionary_id', $data['id']) ->get() ->toArray(); return empty($list) ? [] : $list; } } return false; } /** * 格式化金额|四舍五入保留2位小数 * * @param float $money * @return string */ function moneyFormat($money = 0) { // 格式化并返回 return sprintf('%.2f', floatval($money)); } /** * 数组排序 * * @param string $key * @param array $arr * @param number $order * @return boolean|multitype */ function arrSort($key = '', $arr = [], $order = 1) { $res = []; // 产生结构数组 foreach ($arr as $k => $v) { $res[$v[$key]] = isset($res[$v[$key]]) ? array_merge($res[$v[$key]], [ $k ]) : [ $k ]; } if ($order == 1) { // 升序 ksort($res); } elseif ($order == 0) { // 降序 krsort($res); } else { return false; } $rs = []; // 组装数组 foreach ($res as $value) { foreach ($value as $n) { $rs[] = $arr[$n]; } } // 返回结果 return $rs; } /** * 计算每期的日期(当前日减一天|当月不足则取最后一天) * * @param string $start_date * @param int $total_month * @param bool $return_last * @return array|string */ function calculateDate($start_date, $total_month, $return_last = false) { // 开始时间 $start_day = intval(date('j', strtotime($start_date))); $start_time = strtotime('-1 day', strtotime($start_date)); // 当前年月日 $curr_year = intval(date('Y', $start_time)); $curr_month = intval(date('n', $start_time)); $curr_day = intval(date('j', $start_time)); // 格式化数组 $date = [ $start_date ]; // 循环计算 for ($i = 1; $i <= $total_month; $i ++) { // 年 if (($curr_month + $i) % 12 == 0) { $year = $curr_year + ($curr_month + $i) / 12 - 1; } else { $year = $curr_year + floor(($curr_month + $i) / 12); } // 月 $month = ($curr_month + $i) % 12; $month = ($month == 0 ? 12 : $month); // 日 $curr_month_days = intval(date('t', strtotime("{$year}-{$month}-01"))); $day = $start_day == 1 ? $curr_month_days : min($curr_day, $curr_month_days); // 当期时间 $date[] = sprintf('%04d-%02d-%02d', $year, $month, $day); } // 返回 if ($return_last) { // 返回最后一期 return array_pop($date); } else { // 返回所有日期 return $date; } } /** * 验证手机是否有效 */ function isMobile($subject = '') { $pattern = "/^1[3|4|5|7|8][0-9]{9}$/"; if (preg_match($pattern, $subject)) { return true; } return false; } /** * 数字转中文 * * @param unknown $num * @param number $m */ function numberToChinese($num) { $CNum = [ [ '零', '一', '二', '三', '四', '五', '六', '七', '八', '九' ], [ '', '十', '百', '千' ], [ '', '万', '亿', '万亿' ] ]; // 验证是否是数字 if (! is_numeric($num)) { return false; } $flt = ''; if (is_integer($num)) { $num = strval($num); } else if (is_numeric($num)) { $num = strval($num); $rs = explode('.', $num, 2); $num = $rs[0]; $flt = $rs[1]; } $len = strlen($num); $num = strrev($num); $chinese = ''; for ($i = 0, $k = 0; $i < $len; $i += 4, $k ++) { $tmp_str = ''; $str = strrev(substr($num, $i, 4)); $str = str_pad($str, 4, '0', STR_PAD_LEFT); for ($j = 0; $j < 4; $j ++) { if ($str{$j} !== '0') { $tmp_str .= $CNum[0][$str{$j}] . $CNum[1][4 - 1 - $j]; } } $tmp_str .= $CNum[2][$k]; $chinese = $tmp_str . $chinese; unset($str); } if ($flt !== '') { $str = ''; for ($i = 0; $i < strlen($flt); $i ++) { $str .= $CNum[0][$flt{$i}]; } $chinese .= "点{$str}"; } return $chinese; } /** * 数字金额转换成中文大写金额的函数 * String Int $num 要转换的小写数字或小写字符串 * return 大写字母 * 小数位为两位 */ function getAmount($num) { $c1 = "零壹贰叁肆伍陆柒捌玖"; $c2 = "分角元拾佰仟万拾佰仟亿"; $num = round($num, 2); $num = $num * 100; if (strlen($num) > 10) { return "数据格式错误"; } $i = 0; $c = ""; while (1) { if ($i == 0) { $n = substr($num, strlen($num) - 1, 1); } else { $n = $num % 10; } $p1 = substr($c1, 3 * $n, 3); $p2 = substr($c2, 3 * $i, 3); if ($n != '0' || ($n == '0' && ($p2 == '亿' || $p2 == '万' || $p2 == '元'))) { $c = $p1 . $p2 . $c; } else { $c = $p1 . $c; } $i = $i + 1; $num = $num / 10; $num = (int) $num; if ($num == 0) { break; } } $j = 0; $slen = strlen($c); while ($j < $slen) { $m = substr($c, $j, 6); if ($m == '零元' || $m == '零万' || $m == '零亿' || $m == '零零') { $left = substr($c, 0, $j); $right = substr($c, $j + 3); $c = $left . $right; $j = $j - 3; $slen = $slen - 3; } $j = $j + 3; } if (substr($c, strlen($c) - 3, 3) == '零') { $c = substr($c, 0, strlen($c) - 3); } if (empty($c)) { return "零元整"; } else { return $c . "整"; } }
Aes 加密
在写app接口的时候,用到AES加解密,关于这块有点陌生,稍微了解了一下,这个是ECB加密,每次加密一样,更安全的需要CBC。
namespace app\common\lib; class Aes { /** * 对加密的数据进行加密 * @param $request * @return string */ public function aesEncryptRequest($request) { $res = $this->encryptPass($request,config('app.aes_key')); return $res; } /** * 加密 * @param array $request * @param string $key * @return string */ private function encryptPass($request,$key='') { $size = mcrypt_get_block_size(MCRYPT_RIJNDAEL_128,MCRYPT_MODE_ECB); $input =$this->pkcs5_pad($request,$size); $td = mcrypt_module_open(MCRYPT_RIJNDAEL_128,'',MCRYPT_MODE_ECB,''); $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td),MCRYPT_RAND); mcrypt_generic_init($td,$key,$iv); $data = mcrypt_generic($td,$input); mcrypt_generic_deinit($td); mcrypt_module_close($td); $data = base64_encode($data); return $data; } //填充 private function pkcs5_pad($text,$blockSize) { $pad = $blockSize - (strlen($text)%$blockSize); return $text.str_repeat(chr($pad),$pad); } /** * 对数据进行AES解密 * @param $data * @return bool|string */ public function aesDecryptRequest($data) { $res = $this->decryptPass($data,config('app.aes_key')); return $res; } /** * 解密 * @param $data * @param $key * @return bool|string */ private function decryptPass($data,$key) { $decrypted = mcrypt_decrypt(MCRYPT_RIJNDAEL_128,$key, base64_decode($data), MCRYPT_MODE_ECB); $dec_s = strlen($decrypted); $padding = ord($decrypted[$dec_s-1]); $decrypted = substr($decrypted,0,-$padding); return $decrypted; } }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>JQuery获取文本框的值</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <script src="jquery-1.5.1.min.js" type="text/javascript"></script> <script type="text/javascript"> //使用id的方式获取 $(document).ready(function(){ //1 $("#button_text1").click(function(){ var result1 = $("#input_text1").val(); alert("result1 = " + result1); }); //2 $("#button_text2").click(function(){ var result2 = $("input[id='input_text2']").val(); alert("result2 = " + result2); }); //3 $("#button_text3").click(function(){ var result3 = $("input[id='input_text3']").attr("value"); alert("result3 = " + result3); }); //4. 可以通过type的值来获取input中的值(未演示) /* $("#button_text4").click(function(){ var result4 = $("input[type='text']").val(); alert("result4 = " + result4); }); */ //5. 可以通过name的值来获取input中的值(未演示) /* $("#button_text5").click(function(){ var result5 = $("input[name='text']").val(); alert("result5 = " + result5); }); */ }); </script> </head> <body> <!-- 获取文本框的值:方式一 --> <div id="test1"> <input id="input_text1" type="text" value="test1" style="width: 100px;" /> <button id="button_text1">test1</button> </div> <!-- 获取文本框的值:方式二 --> <div id="test2"> <input id="input_text2" type="text" value="test2" style="width: 100px;" /> <button id="button_text2">test2</button> </div> <!-- 获取文本框的值:方式三 --> <div id="test3"> <input id="input_text3" type="text" value="test3" style="width: 100px;" /> <button id="button_text3">test3</button> </div> </body> </html>
.attr("value") 的值在定义input的时候就确定下来了, 或者说是个默认值, 并不会随着用户的输入而改变, 所以应该用val()而不该用.attr("value")
MySQL默认端口:3306
DMS与MySQL服务器无法建立连接,请检查连接地址的正确性、网络畅通情况、白名单设置后再进行重试