Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
javascript代码没有执行!_Javascript_Html_Css_Xml_Svg - Fatal编程技术网

javascript代码没有执行!

javascript代码没有执行!,javascript,html,css,xml,svg,Javascript,Html,Css,Xml,Svg,我有一个index.html,比如: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" conte

我有一个index.html,比如:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JavaScript Tooltip Demo</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<embed src="usmap.svg" width="3000" height="1000"
type="image/svg+xml"
pluginspage="http://www.adobe.com/svg/viewer/install/" />
<script type="text/javascript" language="javascript" src="script.js"></script>
</body>
</html>
它什么也没做


有人知道原因吗?

您的XHTML是无效的,您在其中嵌入SVG的非标准方法是作为一个单独的文档(与父文档不共享同一个窗口对象)来实现的


不过,该脚本一开始并不是为SVG编写的,它包含特定于IE的内容,IE不支持SVG。

您的XHTML无效,而且您将SVG嵌入其中的非标准方法作为单独的文档(与父文档不共享同一个窗口对象)来实现

<embed src="usmap.svg" ...
<script type="text/javascript" language="javascript" src="script.js"></script>

不过,这个脚本一开始并不是为SVG编写的,它包含特定于IE的内容,并且IE不支持SVG。

不,这个很好,在这里发回关于不透明的文章不,这个很好,在这里发回关于不透明的文章我不确定我是否理解。我在SVG中有onmouseover事件,它应该调用javascript函数。你的答案是错误的,因为我可以用这种方式调用其他函数,只是这个函数根本没有响应。我不确定我是否理解。我在SVG中有onmouseover事件,它应该调用javascript函数。你的答案是错误的,因为我可以用这种方式调用其他函数,只是这一个根本没有响应
<embed src="usmap.svg" ...
<script type="text/javascript" language="javascript" src="script.js"></script>
<embed src="usmap.svg" ...
<script type="text/javascript" language="javascript" src="script.js"></script>