Upload
felix-geisendoerfer
View
4.911
Download
0
Tags:
Embed Size (px)
DESCRIPTION
Citation preview
ActiveDOMjQuery(‘a.nd > html :tricks’).for(‘web application’).data();
by Felix Geisendörfer
About me
• Felix Geisendörfer, 20 years old, Germany
• Blogger / Programmer / Entrepreneur
• Used jQuery in all battle fields
• School projects, small business sites, 300++ DB table monster project
Key ideas
• Make the DOM represent you data (semantics)
• Abstract the DOM interaction away from
• Known your audience - no silver bullets.
• JSON is your friend in times of trouble.
Data on your server
Database
posts
users
tags
Tables Rows
id
user_id
title
text
created
modified
Columns
Data in your client
id
user_id
title
text
created
modified
Table ‘posts’ DOM / Html representation
Manipulating data in the DOM
Lets say we want to change the ‘text’ field ...
This is why we love, jQuery!
Lets make it more difficult ...
Lets try to change the ‘user_id’ ...
And a last one
Changing the ‘created’ column
What about reading the data?
What is the Pattern?
Mapping columns to get /set functions
id
user_id
title
text
created
modified
Columns DOM transformation / access functions
get
set
get
set
getset
A map for DOM-land
How to use the map?
?
Use it directly?
beats
Problems
• Only operates on one ‘post’ object
• Clumsy syntax
• No Chaining
How far can you go?
with some abstraction
with custom css selectors
How to get there?
• Plugin generator
• Routing plugin function calls to sub-functions
• Re-using the ‘fields’ map logic for plugins
Questions?
Thanks goes to John & the jQuery team!
Talk will be online at: thinkingphp.org