- AMP:Building Accelerated Mobile Pages
- Ruadhan O'Donoghue
- 79字
- 2021-07-08 10:04:01
Using JavaScript in AMP pages
Let's deal with our first non-boilerplate error message:
The tag 'script' is disallowed except in specific forms.
In AMP, to guarantee performance, the use of JavaScript is greatly restricted. You can't write your own scripts, or include non-AMP JavaScript code. To fix this error, just remove the following line from your AMP document.
<script type="text/javascript" src="script.js"></script>
Don't worry, it's not needed. It was only included to demonstrate what the validator thinks of you including your own JavaScript!
推薦閱讀
- Android Wearable Programming
- 新編Visual Basic程序設計上機實驗教程
- C#完全自學教程
- Instant 960 Grid System
- Java面向對象程序開發及實戰
- WordPress Plugin Development Cookbook(Second Edition)
- C++ 從入門到項目實踐(超值版)
- Mastering Backbone.js
- Go語言精進之路:從新手到高手的編程思想、方法和技巧(2)
- Python 3 數據分析與機器學習實戰
- Robot Framework Test Automation
- Implementing DevOps with Ansible 2
- 深入理解C++11:C++11新特性解析與應用
- Oracle 11g寶典
- MATLAB/Simulink與過程控制系統仿真