Javascript的encodeURIComponent()和decodeURIComponent()函数
Posted by quentin 在 Friday, 9 September 2011
Javascript下有自己的URLencode函数,并不要我们自己去实现。如下:
编码函数:encodeURIComponent()
解码函数:decodeURIComponent()
感觉还是挺方便的,跟PHP 的urlencode一样好用。
求知若渴,虚心若愚!
居安思危,积极进取!
Javascript下有自己的URLencode函数,并不要我们自己去实现。如下:
编码函数:encodeURIComponent()
解码函数:decodeURIComponent()
感觉还是挺方便的,跟PHP 的urlencode一样好用。
收集利用Jquery取得iframe中元素的几种方法 :
Js代码
$(document.getElementById('iframeId').contentWindow.document.body).htm()
显示iframe中body元素的内容。
Js代码
$("#testId", document.frames("iframename").document).html();
根据iframename取得其中ID为"testId"元素
收集利用Jquery取得iframe中元素的几种方法 :
Js代码
$(document.getElementById('iframeId').contentWindow.document.body).htm()
显示iframe中body元素的内容。
Js代码
$("#testId", document.frames("iframename").document).html();
根据iframename取得其中ID为"testId"元素
一般来说,脚本和CSS都是在页面中用<script>和<link>来进行引入,也就是说,正如你现在所看到的这张网页一样,是静态的写在html中的。
标准的获取DOM节点的JS代码
判断浏览器是IE还是Firefox
<script>
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName==\'Netscape\')?1:0;
var isIE=(navigator.appName.indexOf(\'Microsoft\')!=-1)?1:0;
}
if (isNN)
alert(\'NETSCAPE [FF/OTHER]\');
if (isIE)
alert(\'IE\');
</script>
鼠标的几种形状
<INPUT TYPE=\"submit\" style=\"cursor: pointer\" value=\"hand\">
形状值如下:
auto :标准光标
default :标准箭头
pointer :手形光标
wait :等待光标
text :I形光标
vertical-text :水平I形光标
no-drop :不可拖动光标
not-allowed :无效光标
help :?帮助光标
all-scroll :三角方向标
move :移动标
crosshair :十字标