我刚刚开始使用java脚本,我想从URL中获取元数据...当在输入字段中输入任何URL时,它必须从中提取元数据,这是执行时在html java脚本中使用的基本用法代码抛出错误
我正在寻找任何替代方案,但没有任何帮助。请提供如何实现该功能的任何想法。
<!DOCTYPE html>
<html>
<body>
<head>
<meta name="description" content="Free Web tutorials">
<meta name="keywords" content="HTML5,CSS,JavaScript">
<meta name="author" content="John Doe">
<meta content="http://stackoverflow.com/favicon.ico">
</head>
<p>Click the button to return the value of the content attribute of all meta elements.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = "https://www.amazon.in/"
// var x = document.getElementsByTagName("META");
var txt = "";
var i;
for (i = 0; i < x.length; i++) {
txt = txt + "Content of "+(i+1)+". meta tag: …Run Code Online (Sandbox Code Playgroud)HTML
<div class='block'>
<div class='block-bar'></div>
</div>
CSS
.block-bar {
-webkit-animation: timebar 1s infinite;
-moz-animation: timebar 1s infinite;
animation: timebar 1s infinite;
}
@keyframes timebar {
0% { width: 0%; }
99% { width: 100%; }
100% { width: 0%; }
}
@-webkit-keyframes timebar {
0% { width: 0%; }
99% { width: 100%; }
100% { width: 0; }
}
}
Run Code Online (Sandbox Code Playgroud)
它在Chrome和Firefox中正常工作但在IE中无法正常工作
怎么解决?谢谢.