Python-Ref > Mimo python > JavaScript > Annoying scripts

Klíčová slova
Knihovní funkce

Annoying scripts

Very often Javascript was used in different types of nasty annoyances that opened excessive number of windows with advertisement, hid parts of the browsers UI, move the browser window, etc. For this reason, many browsers today let you switch off commands that were used to these types of things.
The following short HTML shows one example of an annoying behaviour. For it to work, you must allow JavaScript to move your browsers window.
Zdroj: (js6-1.html)
  1   <html>
  2   <title>Annoying rectangle</title>
  3   <body>
  5   <div style="height: 300px; width: 300px; background-color: blue" id="blue">
  6   </div>
  8   <script type="text/javascript">
  9   <!--
  1   self.moveTo(0,0);
  2   document.getElementById("blue").onmousemove = function(e) {
  3   self.moveTo(e.screenX-200, e.screenY-300);
  4   };
  5   -->
 10   </script>
 11   </body>
 12   </html>
Doba běhu: 15.1 ms