0
工作,這是我的XHTML/PHP文件:XHTML + XML加上XSL加的jQuery不要在Safari
<? header('Content-type: application/xhtml+xml')?>
<?="<?xml version=\"1.0\" encoding=\"utf-8\"?>"?>
<?="<?xml-stylesheet type=\"text/xsl\" href=\"ie-fix.php\"?>"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
</head>
<body>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript">
$("body").html("test");
</script>
</body>
</html>
這是XSL/PHP文件(ie-fix.php
):
<? header('Content-type: text/xsl')?>
<?="<?xml version=\"1.0\" encoding=\"utf-8\"?>"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml" version="1.0">
<xsl:output method="xml" encoding="utf-8"></xsl:output>
<xsl:template match="/">
<xsl:copy-of select="node()"></xsl:copy-of>
</xsl:template>
</xsl:stylesheet>
我創造了在這裏解釋:http://www.w3.org/MarkUp/2004/xhtml-faq#ie
我的代碼在Safari 5.0是不行的,我得到的錯誤是:
TypeError: Result of expression 'd.style' [null] is not an object.
ReferenceError: Can't find variable: $
請問誰能幫忙?謝謝!