bennyboywonder Posted March 4, 2007 Share Posted March 4, 2007 *edit* ok, this is a small part of a script from a tutorial, and when I move document.onMouseDown=startDrag; document.onMouseUp=stopDrag; outside of the window.onload handler (wasn't sure why he did that anyway) then it works. HOWEVER this only works when I include it in the main HTML document. If the script is imported via a js file, it doesn't work *edit* trying to do a drag and drop script for my website. Halted at the very outset. this just WILL NOT WORK. help me here function startDrag(e) { alert("dragging started"); } function stopDrag(e) { alert("dragging stopped"); } window.onload = function() { document.onMouseDown=startDrag; document.onMouseUp=stopDrag; } Link to comment https://forums.phpfreaks.com/topic/41118-solved-attaching-event-handlers/ Share on other sites More sharing options...
bennyboywonder Posted March 4, 2007 Author Share Posted March 4, 2007 ok. ignore this, I am a moron. I had previously already defined two blank startdrag functions as placeholders and it was calling them instead Link to comment https://forums.phpfreaks.com/topic/41118-solved-attaching-event-handlers/#findComment-199165 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.