Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/398.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 SyntaxError:意外标记<; 函数isIE(){ var myNav=navigator.userAgent.toLowerCase(); 返回(myNav.indexOf('msie')!=-1)?parseInt(myNav.split('msie')[1]):false; } window.isIEOld=isIE()&&isIE()599&&!isIEOld&&!isiPad){ el+=''; el+=''; el+=''; }否则{ el=''; } $('.video').prepend(el);_Javascript_Jquery - Fatal编程技术网

Javascript SyntaxError:意外标记<; 函数isIE(){ var myNav=navigator.userAgent.toLowerCase(); 返回(myNav.indexOf('msie')!=-1)?parseInt(myNav.split('msie')[1]):false; } window.isIEOld=isIE()&&isIE()599&&!isIEOld&&!isiPad){ el+=''; el+=''; el+=''; }否则{ el=''; } $('.video').prepend(el);

Javascript SyntaxError:意外标记<; 函数isIE(){ var myNav=navigator.userAgent.toLowerCase(); 返回(myNav.indexOf('msie')!=-1)?parseInt(myNav.split('msie')[1]):false; } window.isIEOld=isIE()&&isIE()599&&!isIEOld&&!isiPad){ el+=''; el+=''; el+=''; }否则{ el=''; } $('.video').prepend(el);,javascript,jquery,Javascript,Jquery,我得到这个js错误,但不知道为什么。。。它不引用行号。我正在Wordpress functions.php中将脚本排队…您的脚本标记不正确: <script type="text/javascript"> function isIE () { var myNav = navigator.userAgent.toLowerCase(); return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')

我得到这个js错误,但不知道为什么。。。它不引用行号。我正在Wordpress functions.php中将脚本排队…

您的脚本标记不正确:

<script type="text/javascript">
function isIE () {
    var myNav = navigator.userAgent.toLowerCase();
    return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;
}

window.isIEOld = isIE() && isIE() < 9;
window.isiPad = navigator.userAgent.match(/iPad/i);

var img = $('.video').data('placeholder'),
    video = $('.video').data('video'),
    noVideo = $('.video').data('src'),
    el = '';

if($(window).width() > 599 && !isIEOld && !isiPad) {
    el +=   '<video autoplay loop poster="' + img + '">';
    el +=       '<source src="' + video + '" type="video/mp4">';
    el +=   '</video>';
} else {
    el = '<div class="video-element" style="background-image: url(' + noVideo + ')"></div>';
}

$('.video').prepend(el);
</script>

应明确为:

<script type="text/html">

thx。。我粘贴了一个我正在试验的早期版本。正确的脚本如下所示:
<script type="text/javascript">