<html>
<head>
<title>檢測對象是否為原始對象</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script src="http://www.xianlaiwan.cn/data/jquery-1.8.2.min.js" type="text/javascript"></script>
</head>
<body>
<div id="divtest">
<div class="title">
<span class="fl">檢測對象是否為原始對象</span>
</div>
<div class="content"></div>
</div>
<script type="text/javascript">
$(function () {
var obj = "null";
var strTmp = "您定義了一個:";
if (?) { //檢測是否為原始對象
strTmp += "原始對象";
}
else {
strTmp += "非原始對象";
}
$(".content").html(strTmp);
});
</script>
</body>
</html>
#divtest
{
width: 282px;
}
#divtest .title
{
padding: 8px;
background-color: Blue;
color: #fff;
height: 23px;
line-height: 23px;
font-size: 15px;
font-weight: bold;
}
#divtest .content
{
padding: 8px;
background-color: #fff;
font-size: 13px;
}
.fl
{
float: left;
}
.fr
{
float: right;
}