admin管理员组文章数量:1026662
In IE 11 and IE 10 I am having a invalid character error on the line below:
if (!plugin.$element.attr(``data-${ pluginName }``)) {
I know this is due to ES6 not being supported but I do not know how I can sort this out. Foundation already includes babel and I thought that this script below would fix the issue but hasn't.
return gulp.src(PATHS.javascript)
.pipe($.sourcemaps.init())
.pipe($.babel())
.pipe($.concat('foundation.js', {
newLine:'\n;'
}))
.pipe($.if(isProduction, uglify))
.pipe($.if(!isProduction, $.sourcemaps.write()))
.pipe(gulp.dest('assets/javascript'))
.pipe(browserSync.stream());
});
This is a problem in the foundation.core.js file that is included with Foundation.
To see this problem you can navigate to the below url and load it in IE 11 or 10: /
Has anyone got a fix for this?
In IE 11 and IE 10 I am having a invalid character error on the line below:
if (!plugin.$element.attr(``data-${ pluginName }``)) {
I know this is due to ES6 not being supported but I do not know how I can sort this out. Foundation already includes babel and I thought that this script below would fix the issue but hasn't.
return gulp.src(PATHS.javascript)
.pipe($.sourcemaps.init())
.pipe($.babel())
.pipe($.concat('foundation.js', {
newLine:'\n;'
}))
.pipe($.if(isProduction, uglify))
.pipe($.if(!isProduction, $.sourcemaps.write()))
.pipe(gulp.dest('assets/javascript'))
.pipe(browserSync.stream());
});
This is a problem in the foundation.core.js file that is included with Foundation.
To see this problem you can navigate to the below url and load it in IE 11 or 10: http://b20.2c7.mwp.accessdomain./
Has anyone got a fix for this?
Share Improve this question edited Nov 8, 2016 at 20:30 Kevin B 95.1k16 gold badges167 silver badges186 bronze badges asked Nov 8, 2016 at 20:07 Max LynnMax Lynn 3972 gold badges6 silver badges17 bronze badges 1- Why has this been marked down? – Max Lynn Commented Nov 8, 2016 at 20:12
2 Answers
Reset to default 3I fixed the problem by re installed bower and it worked fine.. odd..
Internet Explorer 11 doesn't support some of ES6 features. Along with these non supported are template literals.
See https://developer.mozilla/en-US/docs/Web/JavaScript/Reference/Template_literals for patibility.
Best approach would be to use babel and its plugin to transform template literals.
Install the babel plugin
npm install --save-dev babel-plugin-transform-es2015-template-literals
Add it in .babelrc in plugins section
// without options
{
"plugins": ["transform-es2015-template-literals"]
}
// with options
{
"plugins": [
["transform-es2015-template-literals", {
"loose": true,
"spec": true
}]
]
}
IN gulpfile.babel.js, make sure that everything is parsed through babel-loader, so probably ment out excluded files ( most of these are foundation related ) from being parsed through babel-loader
So literals like in this example:
`foo${bar}`;
Would bee this:
"foo" + bar;
see more: https://www.npmjs./package/babel-plugin-transform-es2015-template-literals
In IE 11 and IE 10 I am having a invalid character error on the line below:
if (!plugin.$element.attr(``data-${ pluginName }``)) {
I know this is due to ES6 not being supported but I do not know how I can sort this out. Foundation already includes babel and I thought that this script below would fix the issue but hasn't.
return gulp.src(PATHS.javascript)
.pipe($.sourcemaps.init())
.pipe($.babel())
.pipe($.concat('foundation.js', {
newLine:'\n;'
}))
.pipe($.if(isProduction, uglify))
.pipe($.if(!isProduction, $.sourcemaps.write()))
.pipe(gulp.dest('assets/javascript'))
.pipe(browserSync.stream());
});
This is a problem in the foundation.core.js file that is included with Foundation.
To see this problem you can navigate to the below url and load it in IE 11 or 10: /
Has anyone got a fix for this?
In IE 11 and IE 10 I am having a invalid character error on the line below:
if (!plugin.$element.attr(``data-${ pluginName }``)) {
I know this is due to ES6 not being supported but I do not know how I can sort this out. Foundation already includes babel and I thought that this script below would fix the issue but hasn't.
return gulp.src(PATHS.javascript)
.pipe($.sourcemaps.init())
.pipe($.babel())
.pipe($.concat('foundation.js', {
newLine:'\n;'
}))
.pipe($.if(isProduction, uglify))
.pipe($.if(!isProduction, $.sourcemaps.write()))
.pipe(gulp.dest('assets/javascript'))
.pipe(browserSync.stream());
});
This is a problem in the foundation.core.js file that is included with Foundation.
To see this problem you can navigate to the below url and load it in IE 11 or 10: http://b20.2c7.mwp.accessdomain./
Has anyone got a fix for this?
Share Improve this question edited Nov 8, 2016 at 20:30 Kevin B 95.1k16 gold badges167 silver badges186 bronze badges asked Nov 8, 2016 at 20:07 Max LynnMax Lynn 3972 gold badges6 silver badges17 bronze badges 1- Why has this been marked down? – Max Lynn Commented Nov 8, 2016 at 20:12
2 Answers
Reset to default 3I fixed the problem by re installed bower and it worked fine.. odd..
Internet Explorer 11 doesn't support some of ES6 features. Along with these non supported are template literals.
See https://developer.mozilla/en-US/docs/Web/JavaScript/Reference/Template_literals for patibility.
Best approach would be to use babel and its plugin to transform template literals.
Install the babel plugin
npm install --save-dev babel-plugin-transform-es2015-template-literals
Add it in .babelrc in plugins section
// without options
{
"plugins": ["transform-es2015-template-literals"]
}
// with options
{
"plugins": [
["transform-es2015-template-literals", {
"loose": true,
"spec": true
}]
]
}
IN gulpfile.babel.js, make sure that everything is parsed through babel-loader, so probably ment out excluded files ( most of these are foundation related ) from being parsed through babel-loader
So literals like in this example:
`foo${bar}`;
Would bee this:
"foo" + bar;
see more: https://www.npmjs./package/babel-plugin-transform-es2015-template-literals
本文标签: javascriptInvalid Character IE 11Stack Overflow
版权声明:本文标题:javascript - Invalid Character IE 11 - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745648227a2161153.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论