yin_yang

JavaScript | AJAX

In addition to improving load time and multi-platform compatibility, JavaScript and AJAX create a dynamic Web 2.0 user experience. It’s true: JavaScript can change the way you live your life.

JavaScript Links


JavaScript and AJAX Toolkit


Debugging

JavaScript can be a pain debugging. Although loosely typed and forgiving with syntax, there are still a number of issues that will frustrate. To start:

Add in an alert box to make sure statements work

alert("Test");

Determine if targeting is correct by parsing the value
if alert == to None, then it is finding.
If alert == undefined, then it is not finding.

alert("form.Node=" + form.Node.value);


JavaScript & DOM Manipulation

Change cursor — Roll over each one to see it

onmouseover = "this.style.cursor='pointer';"
Cursors: crosshair, default, e-resize, help, move, n-resize, ne-resize, nw-resize, pointer, progress, s-resize, se-resize, sw-resize, text, w-resize, wait, inherit

Browser functions

<a href="javascript:window.close();">Close window</a>
<a
href="javascript:history.back(1);">Go back</a>
<a
href="javascript:location.reload();">Reload</a>
<a
href="javascript:window.print();">Print me</a>
<a
href="javascript:void();">This link won’t work</a>

Conditional comments

<!--[if !IE]><!-->
<a href="#" onclick="alert('Use IE');">Text</a>
<![endif]-->
<!--[if IE]>

<a href="url">Text</a>
<![endif]-->

back to top