我有一個html文件,使用它來渲染反應組件。 這裏是我的html文件未捕獲的SyntaxError:意外的令牌)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../../../elements/css/elements.css"/>
<link rel="shortcut icon" href="http://example.com/myicon.ico"/>
</head>
<body>
<h1>Text Modal Demo</h1>
<p>Styled using the Elements SDK.</p>
<br/>
<div id="app"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.3.2/react.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.3.2/react-dom.js"></script>
<script src="https://cdn.polyfill.io/v2/polyfill.js?features=CustomEvent,Intl.~locale.en,Intl.~locale.fr"></script>
<script type="text/javascript" src="../../jsfiles/textModal/dist.text-modal.js"></script>
<script type="text/javascript" src="../../jsfiles/textModal/text-modal.js"></script>
</body>
</html>
這裏是我的文本文件modal.js
function init() {
// Demo eventing API
document.body.dispatchEvent(new CustomEvent('o.InitTextModal', {
detail: { elementId: 'app', contentTemplateLarge: true, footerVisible: true, successBtnCallback:() => { console.log('¡¡success button pressed!!') }}
}
));
}
window.onload = init;
當我嘗試加載HTML文件,我在控制檯 未捕獲的SyntaxError看到此錯誤:意外的令牌)在行5 text-modal.js 這是這條線 - 細節:{ elementId: 'app', contentTemplateLarge: true, footerVisible: true, successBtnCallback:() => { console.log('¡¡success button pressed!!') }}
此問題僅在IE 11和Android設備上可見。適用於iOS的工作正常
IE11是否支持箭頭功能? – 2016-11-10 02:22:58
否http://caniuse.com/#search=arrow –