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.

102<br />

<strong>JavaScript</strong> <strong>Examples</strong> <strong>Bible</strong>: The Essential Companion to <strong>JavaScript</strong> <strong>Bible</strong><br />

elementObject.onCopy<br />

}<br />

Listing 15-36 (continued)<br />

elem.innerText = “”<br />

event.returnValue = false<br />

function handlePaste() {<br />

var elem = window.event.srcElement<br />

if (elem.className == “blanks”) {<br />

elem.innerHTML = clipboardData.getData(“Text”)<br />

}<br />

event.returnValue = false<br />

}<br />

function handleBeforePaste() {<br />

var elem = window.event.srcElement<br />

if (elem.className == “blanks”) {<br />

event.returnValue = false<br />

}<br />

}<br />

<br />

<br />

<br />

onBeforeCut and onCut Event Handlers<br />

<br />

Your goal is to cut and paste one noun and one<br />

adjective from the following table into the blanks<br />

of the sentence. Select a word from the table and<br />

use the Edit or context menu to cut it from the table.<br />

Select one or more spaces of the blanks in the<br />

sentence and choose Paste to replace the blank with<br />

the clipboard contents.<br />

<br />

NounsAdjectives<br />

truckround<br />

dollred<br />

ballpretty<br />

<br />

<br />

Pat said, “Oh my, the <br />

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />

is so <br />

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;!”<br />

Reset<br />

<br />

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

Saved successfully!

Ooh no, something went wrong!