You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.4 KiB
Markdown

# JavaScript
1 year ago
JavaScript (not to be confused with completely unrelated [Java](java.md) language) is a [bloated](bloat.md) [programming language](programming_language.md) used mainly on the [web](www.md).
6 months ago
TODO: some more shit
1 year ago
TODO
```
"11" + 1 // "111"
"11" - 1 // 10
6 months ago
```
Here is how to **make your page work only with JavaScript turned off**:
```
<html>
<head>
<script>
function nuke() { document.body.innerHTML = "<p>disable JavaScript to view this page</p>"; }
</script>
</head>
<body onload="nuke()">
<h1> My awesome page </h1>
<p> My awesome page text :) </p>
</body>
</html>
```
5 months ago
{ NOTE: Remember that normally breaking compatibility on purpose is probably bad, it shouldn't be done seriously (don't waste effort on breaking something, rather make something nice, also censorship is always bad), but it's a nice [troll](troll.md) :D Don't forget to have fun sometimes. ~drummyfish }
Or this will give an epileptic seizures seizure to everyone who has Javascript on:
```
<html>
<head>
<script>
alert("Turn off Javascript to make it stop.");
var count = 0;
function go()
{
count += 1;
document.body.style.backgroundColor = (count % 2) ? "red" : "blue";
document.body.style.color = (count % 2) ? "green" : "yellow";
document.body.style["font-size"] = (count % 64).toString() + "px";
setTimeout(go,10);
}
</script>
</head>
<body onload="go()">
<h1> My awesome page </h1>
<p> My awesome page text :) </p>
</body>
</html>
```