Posts Tagged ‘ Javascript ’
<script type="text/javascript"> // Created by: Stuart Colville | http://muffinresearch.co.uk/ function getElementsByClassName(strClass, strTag, objContElm) { strTag = strTag || "*"; objContElm = objContElm || document; var objColl = objContElm.getElementsByTagName(strTag); if (!objColl.length && strTag == "*" && objContElm.all) objColl = objContElm.all; var arr = new Array(); var delim = strClass.indexOf(‘|’) != -1 ? ‘|’ : ‘ ‘; var arrClass = strClass.split(delim); for (var i [ READ MORE ]
Đối tượng Math là một trong những đối tượng có sẵn của Javascript, nó bao gồm một số thuộc tính và phương thức cơ bản để làm việc với toán học. Mặc dù là một trong số những đối tượng có sẵn của Javascript, nhưng khi làm việc cùng đối tượng Math chúng [ READ MORE ]
Giải trình các phương thức và thuộc tính của đối tượng Array trong Javascript. Mảng là một trong những từ khóa rất thông dụng trong các ngôn ngữ lập trình, nó là đơn giản nhất cho phần dữ liệu có cấu trúc. Javascript tự nhiên cũng hỗ trợ mảng, không những thế còn [ READ MORE ]
Sử dụng: window.name_frame.location <script> function getUrl(){ alert(window._Frame.location); } </script> <iframe name="_Frame" src="http://thuongtin.net"></iframe> <a href="http://google.com" target="_Frame">Google.com</a> <a href="javascript:getUrl()">Get URL</a> loadt2player(360)[ READ MORE ]
Các trang web cho nén javascript Muốn làm trang web của mình chạy nhanh hơn thì phải làm sao cho các dữ liệu nhẹ, câu truy vấn gọn. ^^ Đôi khi trang web làm chứa 1 đống javascript làm trang web chạy chậm. Vì thế việc tối ưu các đoạn javascript là cần thiết để cải thiện [ READ MORE ]
Lấy chiều rộng và chiều cao cửa sổ đang mở = JavaScript var theWidth, theHeight; // Window dimensions: if (window.innerWidth) { theWidth=window.innerWidth; } else if (document.documentElement && document.documentElement.clientWidth) { theWidth=document.documentElement.clientWidth; } else if (document.body) { theWidth=document.body.clientWidth; } if (window.innerHeight) { theHeight=window.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { theHeight=document.documentElement.clientHeight; } else if (document.body) { theHeight=document.body.clientHeight; } loadt2player(325)[ READ MORE ]
Lúc trước muốn gọi 1 file Script thì dùng: <script> document.write('<scr'+'ipt src="http://thuongtin.net/js.js"></scr'+'ipt>'); </script> Giờ nghiên cứu về DOM thì dùng: <script> var t2script = document.createElement("script"); t2script.setAttribute("src","http://thuongtin.net/js.js"); document.getElementsByTagName("head")[0].appendChild(t2script); </script> ^^ loadt2player(322)[ READ MORE ]
<script> document.write("Rộng: "+screen.width+"<br />"); document.write("Cao: "+screen.height+"<br />"); </script> loadt2player(320)[ READ MORE ]
Một số Flugin của JQuery trang trí cho form. 1. Justify elements using jQuery and CS. Trang chủ 2. File Style. Demo Homepage loadt2player(296)[ READ MORE ]
Để xác định kích thước thật cửa sổ bộ duyệt, sử dụng những thuộc tính sau đây * in Netscape Navigator 4: window.innerWidth, window.innerHeight * in Microsoft Internet Explorer: document.body.offsetWidth, document.body.offsetHeight Chú ý document.body.offsetWidth và document.body.offsetWidth phải đặt trong tag Body mới có thế get value: var winW = 630, winH = 460; if (parseInt(navigator.appVersion)>3) { if (navigator.appName=="Netscape") { winW = window.innerWidth; winH = [ READ MORE ]
Bad Behavior has blocked 52 access attempts in the last 7 days.