我只是想在我的应用程序中添加一些 Jquery。但是我的 jquery 代码在 firefox os 模拟器中不工作。它在我的桌面浏览器中运行良好。请看一下我附上的图片。怎么了?
这是我正在使用的代码
<!DOCTYPE html>
<html>
<head>
<script src="js/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
$("p").toggle();
});
});
</script>
</head>
<body>
<button>Toggle</button>
<p>This is a paragraph with little content.</p>
</body>
</html>
最佳答案
出于安全原因,您不能在 FirefoxOS 应用程序中使用内联 javascript。您需要将您的 JS 放在它自己的 JS 文件中并包含它。
请参阅初学者应用程序以获取引用代码:https://github.com/mdn/battery-quickstart-starter-template/blob/master/index.html
关于javascript - Jquery 在 firefox os 模拟器中不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33944381/