mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-08 20:47:44 +00:00
44 lines
704 B
HTML
44 lines
704 B
HTML
|
<html>
|
||
|
<head>
|
||
|
<title>Misc. Samples</title>
|
||
|
</head>
|
||
|
|
||
|
<body>
|
||
|
|
||
|
<!-- debugger detects onclick handlers, but not javascript: urls -->
|
||
|
<a href="" onclick="alert('clicked');return false;">click me (onclick) debugger detects</a><BR>
|
||
|
<a href="javascript:alert('clicked')">click me (javascript:) debugger ignores</a><BR>
|
||
|
|
||
|
<!-- debugger detects simple src- includes -->
|
||
|
<script SRC=include.js>
|
||
|
</script>
|
||
|
<BR>
|
||
|
|
||
|
<!-- some oddball code for playing with var scoping behavior in JavaScript -->
|
||
|
<script>
|
||
|
function show(y) { document.writeln( y + ", "); }
|
||
|
|
||
|
function A()
|
||
|
{
|
||
|
var x = 1;
|
||
|
show(x);
|
||
|
B();
|
||
|
show(x);
|
||
|
}
|
||
|
|
||
|
function B()
|
||
|
{
|
||
|
show(x);
|
||
|
x = 2;
|
||
|
show(x);
|
||
|
}
|
||
|
|
||
|
x = 0;
|
||
|
show(x);
|
||
|
A();
|
||
|
show(x);
|
||
|
</script>
|
||
|
|
||
|
</body>
|
||
|
</html>
|