jQuery から Chrome と Mozilla で非常に奇妙な動作に直面しています。関数で非常に一般的なUnexpected token ILLEGAL
エラーが発生していdocument.ready
ます。
署名帳のサンプルで遊んでいるうちに、自分のページで試してみました。Mozilla & Chrome では動作しませんが、IE では動作します。次に、署名パッドのすべての参照を削除し、document.ready 関数内に単純なアラートを配置して観察しました (Chrome JavaScript Errors Notifier のおかげです) Unexpected token ILLEGAL error is occurring when system try to use jQuery reference
。次に、このページ (b.html) 内で完全に機能するサンプル ページ (a.html) からすべてのテキストをコピーし、ページを再度実行しました。b.html ページがエラーをスローしているときに、a.html ページが正常に動作していることに驚きました。両方のページは同じディレクトリにあり、同じ内容を持っています。
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title> </title>
<link rel="stylesheet" href="css/jquery.mobile-1.3.1.min.css">
<link href="css/jquery.signaturepad.css" rel="stylesheet">
<script src="js/jquery-1.9.1.min.js"></script>
<script src="js/jquery.mobile-1.3.1.min.js"></script>
</head>
<body>
<script>
$(document).ready(function () {
alert('hai');
})
</script>
</body>
</html>