Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/387.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/87.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更改iframe src不';行不通_Javascript_Html - Fatal编程技术网

Javascript更改iframe src不';行不通

Javascript更改iframe src不';行不通,javascript,html,Javascript,Html,在我的网站上,我写了这样一个函数: function apri(dat) { document.getElementId('dado').src= dat; } iframe HTML代码如下所示 <iframe id="dado"src="http://mk7vrlist.altervista.org/" width="100%" height="700px" scrolling="yes" frameBorder="0"> Your browser doesn't load

在我的网站上,我写了这样一个函数:

function apri(dat) {
document.getElementId('dado').src= dat;
}
iframe HTML代码如下所示

<iframe id="dado"src="http://mk7vrlist.altervista.org/" width="100%" height="700px" scrolling="yes" frameBorder="0">
  Your browser doesn't load this iframe.
</iframe>
iframe的内容没有改变。我在谷歌上搜索了很多,但没有找到任何解决办法。我能做什么


您认为我应该使用不同的内容而不是iframe吗?

单击文本后检查您的错误控制台。您将看到一条错误消息

SyntaxError: missing ) after argument list
错误是引用问题。您有一个没有引号的字符串

<p onclick="apri('http://mk7vrlist.altervista.org/other/staffpage.html')">
                 ^                                                    ^
              missing                                               missing

^ ^ 失踪


单击文本后检查错误控制台。您将看到一条错误消息

SyntaxError: missing ) after argument list
错误是引用问题。您有一个没有引号的字符串

<p onclick="apri('http://mk7vrlist.altervista.org/other/staffpage.html')">
                 ^                                                    ^
              missing                                               missing

^ ^ 失踪


我发现了另一个错误。如果你看一看apri()我写的“文档”。getElementId('dado')。src=',它应该是getElementById。将此添加到答案中,可以帮助其他用户;)我发现了我犯的另一个错误。如果你看一看apri()我写的“文档”。getElementId('dado')。src=',它应该是getElementById。将此添加到答案中,可以帮助其他用户;)您有“getElementId”。你是说“getElementById”吗?你有“getElementId”。你是说“getElementById”吗?