- 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!
推薦閱讀
- LaTeX Cookbook
- Scratch真好玩:教小孩學(xué)編程
- PySide GUI Application Development(Second Edition)
- Java Web程序設(shè)計(jì)任務(wù)教程
- AppInventor實(shí)踐教程:Android智能應(yīng)用開發(fā)前傳
- Python深度學(xué)習(xí):基于TensorFlow
- 打開Go語言之門:入門、實(shí)戰(zhàn)與進(jìn)階
- 從零開始學(xué)Android開發(fā)
- Java程序設(shè)計(jì)教程
- UI設(shè)計(jì)基礎(chǔ)培訓(xùn)教程(全彩版)
- 計(jì)算機(jī)應(yīng)用基礎(chǔ)案例教程(第二版)
- Learning Cocos2d-JS Game Development
- 關(guān)系數(shù)據(jù)庫與SQL Server 2012(第3版)
- Learning NHibernate 4
- Java EE應(yīng)用開發(fā)及實(shí)訓(xùn)