Javascript

From IPhone Developers' Wiki

Jump to: navigation, search

Contents

[edit] Additional Functionality

[edit] Preventing URL bar from appearing

On iPhone, having href="#" will cause the address bar to drop down. Setting it instead to href="javascript:void();" will provide the same 'dummy click placeholder' service as the "#" but with the added benefit of not causing the address bar to make an appearance on every click.

[edit] Frameworks

The Yahoo! UI Frameworks for drag and drop (actually, all of the drag and drop frameworks) are unsupported by the iPhone because mousedown is not triggered until mouseup. Anything that requires a :hover will not work, however, it may be registered on the mouseup.

[edit] Javascript Events

Functional events work as expected. Modified events work differently from desktop environments. Non-functional events do not trigger at all. Dragging while mousedown scrolls the page.

[edit] Functional

  • form.onreset
  • formfield.onblur
  • formfield.onchange
  • formfield.onclick
  • formfield.onfocus
  • formfield.onkeydown
  • formfield.onkeypress
  • formfield.onkeyup
  • formfield.onmouseout
  • formfield.onmouseover
  • formfield.onmouseup
  • window.onload
  • window.onmousewheel

[edit] Modified

  • onmousedown (triggers after mouseup occurs but before mouseup is fired)

[edit] Non-functional

  • document.onkeydown
  • document.onkeypress
  • document.onkeyup
  • form.onsubmit
  • formfield.ondblclick
  • formfield.onmouseenter
  • formfield.onmouseleave
  • formfield.onmousemove
  • formfield.onselect
  • window.oncontextmenu
  • window.onerror
  • window.onresize
  • window.onscroll

Event Tests:

References:

Personal tools