15.02.2013 Views

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 13 ✦ Event Objects (Chapter 29)<br />

URL and allow only some to process, you would generate an if...else construction<br />

to return true or false to the event handler as needed. A value of return<br />

true allows the normal processing of the DragDrop event to take place after your<br />

event handler function has completed its processing.<br />

Listing 29-12: Obtaining URLs of a DragDrop Event’s<br />

data Property<br />

<br />

<br />

Drag and Drop<br />

<br />

function handleDrag(evt) {<br />

netscape.security.PrivilegeManager.enablePrivilege(“UniversalBrowserRead”)<br />

var URLArray = evt.data<br />

netscape.security.PrivilegeManager.disablePrivilege(“UniversalBrowserRead”)<br />

if (URLArray) {<br />

document.forms[0].output.value = URLArray.join(“\n”)<br />

} else {<br />

document.forms[0].output.value = “Nothing found.”<br />

}<br />

return false<br />

}<br />

<br />

<br />

<br />

Drag a URL to this window (NN4 only).<br />

<br />

<br />

URLs:<br />

<br />

<br />

<br />

<br />

<br />

layerX<br />

layerY<br />

pageX<br />

pageY<br />

screenX<br />

screenY<br />

Compatibility ✓<br />

NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5<br />

411<br />

(NN4) eventObject.layerX

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!