]> git.proxmox.com Git - pve-eslint.git/blob - eslint/docs/rules/no-script-url.md
first commit
[pve-eslint.git] / eslint / docs / rules / no-script-url.md
1 # Disallow Script URLs (no-script-url)
2
3 Using `javascript:` URLs is considered by some as a form of `eval`. Code passed in `javascript:` URLs has to be parsed and evaluated by the browser in the same way that `eval` is processed.
4
5 ## Rule Details
6
7 Examples of **incorrect** code for this rule:
8
9 ```js
10 /*eslint no-script-url: "error"*/
11
12 location.href = "javascript:void(0)";
13 ```
14
15 ## Compatibility
16
17 * **JSHint**: This rule corresponds to `scripturl` rule of JSHint.
18
19 ## Further Reading
20
21 * [What is the matter with script-targeted URLs?](https://stackoverflow.com/questions/13497971/what-is-the-matter-with-script-targeted-urls)