JavaScript DHTML/jQuery/support
Версия от 10:02, 26 мая 2010; (обсуждение)
Содержание
- 1 if a browser can properly interpret the opacity style property
- 2 if doing getElementsByTagName() on an object element returns all descendant elements
- 3 if getAttribute(style) is able to return the inline style specified by an element
- 4 if the browser allows table elements without tbody elements
- 5 if the browser does not clone event handlers when elements are cloned
- 6 if the browser leaves intact the results from getAttribute(href)
- 7 if the browser preserves leading whitespace when innerHTML is used
- 8 If the browser properly serializes link elements when innerHTML is used
- 9 if using appendChildcreateTextNode to inject inline scripts executes them
- 10 Rendering according to the W3C CSS Box Model
- 11 style.cssFloat is used to access the current CSS float value
if a browser can properly interpret the opacity style property
<html>
<head>
<script type="text/javascript" src="js/jquery-1.3.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("p").text(jQuery.support.opacity);
});
</script>
</head>
<body>
<body>
<p></p>
</body>
</html>
if doing getElementsByTagName() on an object element returns all descendant elements
<html>
<head>
<script type="text/javascript" src="js/jquery-1.3.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("p").text(jQuery.support.objectAll);
});
</script>
</head>
<body>
<body>
<p></p>
</body>
</html>
if getAttribute(style) is able to return the inline style specified by an element
<html>
<head>
<script type="text/javascript" src="js/jquery-1.3.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("p").text(jQuery.support.style);
});
</script>
</head>
<body>
<body>
<p></p>
</body>
</html>
if the browser allows table elements without tbody elements
<html>
<head>
<script type="text/javascript" src="js/jquery-1.3.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("p").text(jQuery.support.tbody);
});
</script>
</head>
<body>
<body>
<p></p>
</body>
</html>
if the browser does not clone event handlers when elements are cloned
<html>
<head>
<script type="text/javascript" src="js/jquery-1.3.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("p").text(jQuery.support.noCloneEvent);
});
</script>
</head>
<body>
<body>
<p></p>
</body>
</html>
if the browser leaves intact the results from getAttribute(href)
<html>
<head>
<script type="text/javascript" src="js/jquery-1.3.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("p").text(jQuery.support.hrefNormalized);
});
</script>
</head>
<body>
<body>
<p></p>
</body>
</html>
if the browser preserves leading whitespace when innerHTML is used
<html>
<head>
<script type="text/javascript" src="js/jquery-1.3.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("p").text(jQuery.support.leadingWhitespace);
});
</script>
</head>
<body>
<body>
<p></p>
</body>
</html>
If the browser properly serializes link elements when innerHTML is used
<html>
<head>
<script type="text/javascript" src="js/jquery-1.3.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("p").text(jQuery.support.htmlSerialize);
});
</script>
</head>
<body>
<body>
<p></p>
</body>
</html>
if using appendChildcreateTextNode to inject inline scripts executes them
<html>
<head>
<script type="text/javascript" src="js/jquery-1.3.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("p").text(jQuery.support.scriptEval);
});
</script>
</head>
<body>
<body>
<p></p>
</body>
</html>
Rendering according to the W3C CSS Box Model
<html>
<head>
<script type="text/javascript" src="js/jquery-1.3.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("p").text(jQuery.support.boxModel);
});
</script>
</head>
<body>
<body>
<p></p>
</body>
</html>
style.cssFloat is used to access the current CSS float value
<html>
<head>
<script type="text/javascript" src="js/jquery-1.3.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("p").text(jQuery.support.cssFloat);
});
</script>
</head>
<body>
<body>
<p></p>
</body>
</html>