Created
March 5, 2010 17:07
-
-
Save anonymous/322921 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log('Body script'); | |
YAHOO.util.Event.onDOMReady(function(o) { | |
console.log('DOM Ready'); | |
var handleSuccess = function(o) { | |
alert('Success'); | |
}; | |
var handleFailure = function(o) { | |
alert('Failure'); | |
}; | |
var callback = { | |
success:handleSuccess, | |
failure:handleFailure | |
}; | |
console.log('DOM Middle'); | |
var handle_delete = function (e) { | |
YAHOO.util.Event.preventDefault(e); | |
alert('handle delete'); | |
var delete_link = e.target; | |
var delete_url = delete_link.href; | |
var request = YAHOO.util.Connect.asyncRequest('GET', | |
delete_url, | |
callback | |
); | |
// document.reload(); | |
}; | |
var attachment_items = YAHOO.util.Dom.getElementsByClassName('attac\ | |
hment_delete','a',parent.document.getElementById('attachments'),function(o) {co\ | |
nsole.log(o);console.log(YAHOO.util.Event.addListener(o.id, 'click', handle_del\ | |
ete));console.log(o.id);}); | |
}); | |
console.log('done'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment