用JS判断一个html元素是否存在的五种方法
用javascript判断一个html元素是否存在的五种方法:
1. 判断表单元素是否存在(一)
if("periodPerMonth" in document.theForm){
return true;
}else{
return false;
}
2. 判断页面元素是否存在
if(document.getElementById("XXX")){
//存在
}
3. 判断表单元素是否存在(二)
if(document.theForm.periodPerMonth){
//存在
}
或
if(typeof(document.theForm.periodPerMonth)=="object"){
//存在
}
4. 判断表单是否存在
if(document.theForm){
//存在
}
5.用Jquery写脚本
if ( $("#someID").length > 0 ){
$("#someID").text("hi");
}
相关文档:
1.wkhtmltopdf http://code.google.com/p/wkhtmltopdf/downloads/list
如linu下载wkhtmltopdf-0.9.6-static-i386.tar.bz2
2. tar -jxvf wkhtmltopdf-0.9.6-static-i386.tar.bz2
3。重命名 mv wkhtmltopdf-i386 wkhtmltopdf
4.测试生成pdf ./wkhtm ......
处境堪忧的Adobe Flash将面临另一次打击,在线文档最终也开始表明立场。目前网上大部分文档(PDF、Word文档、幻灯片)只能在Flash播放器内部播放,无法显 示为完整的网页。明天在线文档分享网站Scribd上的数百万份文档不再使 用Flash播放,而是将转化为本地HTML5网页。这些文档不仅可以在iPad上完美显示 ......
Steve Jobs 在"Thoughts on Flash"一文中,谈及网络影音时,多次提到HTML5与H.264两项标准。但是,到底HTML5是什么?Flash和H.264又是什么回事?所以,本文旨在解释它们之间的关系,让大家可以初步了解。
首先,引用Steve Jobs的一段话:
Adobe一再反复宣称Apple的移动设备不能提供"完整 ......
<html>
<head>
<mce:style type="text/css"><!--
td
{
width:50;
height:50;
text-align:center;
vertical-align: center;
}
table
{
vertical-align: bottom;
}
legend
{
text-align:center;
}
fieldset
{
width:300;
......