Web小應用
1、js獲取查詢字串
function GetQueryString(name)
{
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if(r!=null)return unescape(r[2]); return null;
}
2、js獲取文字寬度
function testWordWidth(fontStyle,fontSize,text){
text = text.replace("%","好");
var testDiv = $("<div style = 'position:absolute;left:-100px;top:-100px; font-weight:normal;'></div>");
testDiv.css("font-family",fontStyle).css("font-size",fontSize).html(text);
$('body').append(testDiv);
var returnObj = {};
returnObj.width = testDiv.width();
returnObj.height = testDiv.height();
testDiv.remove();
return returnObj;
}
相關文章
- Maven Web 應用MavenWeb
- 用Spring Web Flow和Terracotta搭建Web應用SpringWeb
- 開發Web應用Web
- web離線應用Web
- [譯] 響應式 Web 應用(四)Web
- [譯] 響應式 Web 應用(五)Web
- Go 編寫 Web 應用GoWeb
- Web應用程式優化Web優化
- SpringBoot中的響應式web應用Spring BootWeb
- BurpSuite在非Web應用測試中的應用UIWeb
- 阿里雲Web應用防火牆知識,瞭解阿里雲Web應用防火牆阿里Web防火牆
- web應用與http協議WebHTTP協議
- 01.DRF-Web應用模式Web模式
- Web應用安全防護-WAFWeb
- 用HBuilder把web應用套殼成appUIWebAPP
- 騰訊雲Web應用防火牆有什麼用?Web應用防火牆是防禦原理介紹Web防火牆
- SAP Spartacus - Progressive Web Applications,漸進式 Web 應用程式WebAPP
- 使用 Lambda Web Adapter 在 Lambda 上 構建 web 應用WebAPT
- 【轉】Docker部署Tomcat及Web應用DockerTomcatWeb
- 利用Burp Suite攻擊Web應用UIWeb
- docker stack滾動更新web應用DockerWeb
- Maven建立Web應用程式專案MavenWeb
- 如何應用於Web框架的搭建Web框架
- 關於 Web 應用的 Prerender 策略Web
- 五、Spring Web應用程式構建SpringWeb
- 八、【spring】web應用安全設計SpringWeb
- 什麼是Web應用防火牆?Web防火牆
- Dart 2 Web 應用遷移指南DartWeb
- MVC應用程式使用Web Services(asmx)MVCWebASM
- Web3.0應用程式架構Web架構
- Azure Terraform(三)部署 Web 應用程式ORMWeb
- 如何使用Visual Studio Code除錯PHP CLI應用和Web應用除錯PHPWeb
- [應用案例]完美自適應WEB開發官網Web
- Web應用課 2.4 CSS——flex、響應式佈局WebCSSFlex
- web前端應用應該關注哪些效能指標?Web前端指標
- 【web】springboot應用增加actuator管理端點WebSpring Boot
- Hummingbird: 在Web上執行Flutter應用WebFlutter
- Web 應用安全性: HTTP簡介WebHTTP
- Spring學習日記(二)Web應用SpringWeb