Chapter 17. Dynamic HTML: Drag and Drop, Data Binding, and Behaviors


Chapter 17. Dynamic HTML: Drag and Drop, Data Binding, and Behaviors

graphics/chic01.gif

In this chapter, we're going to keep working on making our web pages come alive , this time by supporting drag and drop, data binding, and Internet Explorer behaviors.

You can implement drag and drop in two primary ways: implementing visual dragging, and implementing data transfer. Visual dragging involves moving objects around in a web page, and data transfer means dragging and dropping actual data, from text to images, that you can work with in code. Naturally, we'll see both ways.

Data binding is a big topic in the Internet Explorer, and we'll take a look at it here. You can store data in a variety of formatsplain text, HTML format, and even XML documents (we'll see all of these formats here)and display that data in the browser. We'll let the user move through the various records and fields of our data using buttons , and we'll also see how to display our data in tables.

Internet behaviors represent Microsoft's attempt to separate data from code, which is a big programming topic these days. When you separate code from data, the resulting application is cleaner and easier to maintain. Behaviors enable you to place JavaScript code in external files with the extension .htc, and you can associate a behavior with an HTML element using styles (as we'll see in this chapter). You can give a behavior custom properties, methods , and events, just as HTML elements have (as we'll also see in this chapter).

Tip

These database solutions are read-only, which means you can't edit the displayed data in the Internet Explorer. If you want to edit the data in the original database file, you've got to have some software installed on the server, such as Remote Data Server (RDS) support, CGI scripts, or the Microsoft .NET framework. Although these topics are beyond the scope of this book as far as database-handling goes, we will take a look at .NET programming and CGI scripting in Chapter 24, ".NET and Security."


Note

More on styles is coming up in our style sheet chapter, Chapter 21, "Cascading Style Sheets and CGI Programming."




Inside Javascript
Inside JavaScript
ISBN: 0735712859
EAN: 2147483647
Year: 2005
Pages: 492
Authors: Steve Holzner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net