Adding JavaScript events


show more Adding JavaScript events provides you with in-depth training on Web. Taught by Joseph Lowery as part of the HTML5 Projects: Engaging Ecommerce show less
please wait ...

Adding JavaScript events

In the previous lesson, we struggled arduously with the HTML for drag and drop. Okay, okay, there was only one attribute per div. But now we're ready for the main event, and that's bringing in the JavaScript events that will interact with our user's actions. The first thing I'm going to do is bring in some help. When drag and drop was first introduced, browser implementation was all over the map. One developer, Guillaume Bort, took it upon himself to level the playing field with his native drag-and-drop routines, which you can find on GitHub.

I often include his library because it really helps browser compatibility. So, lets head all over to our source code, and I'm going to drop in this script include. And this is located in the _scripts, and it's called jquery.ndd, for native drag and drop, .js. Let's set the type=text/javascript and then close off this tag.

Now, I'm going to link in another script that I've already placed in _scripts folder for this l...

Adding JavaScript events
Video duration: 6m 26s 37m 29s Intermediate

Viewers:

Adding JavaScript events provides you with in-depth training on Web. Taught by Joseph Lowery as part of the HTML5 Projects: Engaging Ecommerce

Subject:
Web
Software:
HTML JavaScript CSS
Author:
please wait ...