私は財団の範囲スライダ付きの電卓を構築しています。それはSafari 9、MacとWindows、Edge 14の最新のChromeとFirefoxでうまくいきますが、Safari 8やIE 11では機能しません。Safari 8ではエラーが表示されますSyntaxError:無効な文字: '' ' javascriptのコードは次のようになります。私は `は「に変更した場合は古いブラウザでは `javascriptで認識されません
Foundation.Move(moveTime, $hndl, function() {
//adjusting the left/top property of the handle, based on the percentage calculated above
$hndl.css(lOrT, `${movement}%`);
if (!_this.options.doubleSided) {
//if single-handled, a simple method to expand the fill bar
_this.$fill.css(hOrW, `${pctOfBar * 100}%`);
} else {
//otherwise, use the css object we created above
_this.$fill.css(css);
}
});
、それは任意のブラウザでは動作しません。誰もが考えている?ありがとう!
もちろん、ES2015は古いブラウザでは動作しません。新しいブラウザでは動作しにくく、テンプレート文字列はES2015の機能です。 – adeneo
JavaScriptを使用するためにBabelを使用https://babeljs.io/ – OregonTrail