SlideShare a Scribd company logo
1 of 88
Download to read offline
Wednesday, September 5, 12
Know Your History(API)
                             Using HTML5 History API to Ajaxify
                                   your Magnolia WebSite



Wednesday, September 5, 12
Agenda
              • The story of when I realized I needed to learn more
                about the history API
              • A stupidly simple example of the code in action
              • A walkthrough of our product tour redesign
              • How it works with magnolia



Wednesday, September 5, 12
About Me
              • William Paoli
              • Front End Web Developer
              • From San Francisco,
                California, USA
              • wpaoli@atlassian.com



Wednesday, September 5, 12
How we work together



              Interactive Marketing Team
            Designers and Web Developers




Wednesday, September 5, 12
How we work together



              Interactive Marketing Team   Product Marketing Managers
            Designers and Web Developers




Wednesday, September 5, 12
How we work together



              Interactive Marketing Team   Product Marketing Managers   Demand Generation
            Designers and Web Developers




Wednesday, September 5, 12
The Website is our
                                Salesperson



Wednesday, September 5, 12
The Atlassian Redesign

              We wanted to go from “This” to “This"

                             August 2012




Wednesday, September 5, 12
The Atlassian Redesign

              We wanted to go from “This” to “This"

                             1,800,000 Visits




Wednesday, September 5, 12
The Atlassian Redesign

              We wanted to go from “This” to “This"

                             4,006,000 Pageviews




Wednesday, September 5, 12
The Atlassian Redesign

              We wanted to go from “This” to “This"




Wednesday, September 5, 12
The Big Redesign



Wednesday, September 5, 12
The Concerns
              • SEO
              • Clean URLS
              • Clean UI
              • Great Performance




Wednesday, September 5, 12
The Concerns
              • SEO
              • Clean URLS
              • Clean UI
              • Great Performance




Wednesday, September 5, 12
The Conversation



Wednesday, September 5, 12
Wednesday, September 5, 12
Wednesday, September 5, 12
Wednesday, September 5, 12
Wednesday, September 5, 12
Wednesday, September 5, 12
Wednesday, September 5, 12
Wednesday, September 5, 12
Wednesday, September 5, 12
Wednesday, September 5, 12
Requirements of New Product Tour

                             Great User Experience
                             Easy to Read and Real URLs
                             Search Engine Friendly/Discoverability
                             Unique page titles for each tab
                             Unique Description and Keywords available

                             Don’t Break Back Button


Wednesday, September 5, 12
“DUDE, you
                             are using
                             the
                             HISTORY
                             API Right?”
Wednesday, September 5, 12
Of course I am, duh...



Wednesday, September 5, 12
Of course I am, duh...
                                So uh...what’s the
                                  History API?

Wednesday, September 5, 12
Wednesday, September 5, 12
window.history.length - returns the number of items

              window.history.go(n)- go forward/backward any number

              window.history.back()- go back

              window.history.forward()- go forward

              window.history.pushState(data, title, url)

              window.history.replaceState(data, title, url)



Wednesday, September 5, 12
window.history.length - returns the number of items

              window.history.go(n)- go forward/backward any number

              window.history.back()- go back

              window.history.forward()- go forward

              window.history.pushState(data, title, url)

              window.history.replaceState(data, title, url)



Wednesday, September 5, 12
window.history.length - returns the number of items

              window.history.go(n)- go forward/backward any number

              window.history.back()- go back

              window.history.forward()- go forward

              window.history.pushState(data, title, url)

              window.history.replaceState(data, title, url)



Wednesday, September 5, 12
history.pushState(data,title,url)




Wednesday, September 5, 12
history.pushState(data,title,url)
                               {tabName:‘foo’}
                             Adds to history.state




Wednesday, September 5, 12
history.pushState(data,title,url)
                                  {tabName:‘foo’}
                             Currently Not Implemented




Wednesday, September 5, 12
history.pushState(data,title,url)
                                  {tabName:‘foo’}


                             Used to modify window.location




Wednesday, September 5, 12
history.pushState(data,title,url)
                               {tabName:‘foo’}


                                       AKA “Fake” URLS




Wednesday, September 5, 12
history.pushState(data,title,url);
                         history.replaceState(data,title,url);




Wednesday, September 5, 12
history.pushState(data,title,url);
                         history.replaceState(data,title,url);
                         window.onpopstate = function(){}



Wednesday, September 5, 12
A useless example that
                        hopefully illustrates
                          how this works


Wednesday, September 5, 12
Level 1
                             Old Skool Style


Wednesday, September 5, 12
Demo of static tabs
              (reload each time)




Wednesday, September 5, 12
Static Site Report Card

                             Great User Experience
                             Easy to Read and Real URLs
                             Search Engine Friendly/Discoverability
                             Unique page titles for each tab
                             Unique Description and Keywords available

                             Don’t Break Back Button


Wednesday, September 5, 12
Static Site Report Card

                             Great User Experience
                             Easy to Read and Real URLs
                             Search Engine Friendly/Discoverability
                             Unique page titles for each tab
                             Unique Description and Keywords available

                             Don’t Break Back Button


Wednesday, September 5, 12
Static Site Report Card

                             Great User Experience
                             Easy to Read and Real URLs
                             Search Engine Friendly/Discoverability
                             Unique page titles for each tab
                             Unique Description and Keywords available

                             Don’t Break Back Button


Wednesday, September 5, 12
Static Site Report Card

                             Great User Experience
                             Easy to Read and Real URLs
                             Search Engine Friendly/Discoverability
                             Unique page titles for each tab
                             Unique Description and Keywords available

                             Don’t Break Back Button


Wednesday, September 5, 12
Static Site Report Card

                             Great User Experience
                             Easy to Read and Real URLs
                             Search Engine Friendly/Discoverability
                             Unique page titles for each tab
                             Unique Description and Keywords available

                             Don’t Break Back Button


Wednesday, September 5, 12
Static Site Report Card

                             Great User Experience
                             Easy to Read and Real URLs
                             Search Engine Friendly/Discoverability
                             Unique page titles for each tab
                             Unique Description and Keywords available

                             Don’t Break Back Button


Wednesday, September 5, 12
Static Site Report Card

                             Great User Experience
                             Easy to Read and Real URLs
                             Search Engine Friendly/Discoverability
                             Unique page titles for each tab
                             Unique Description and Keywords available

                             Don’t Break Back Button


Wednesday, September 5, 12
Level 2
                        Get Some jQuery up in there!




Wednesday, September 5, 12
JS tab solution




Wednesday, September 5, 12
JS Tab Report Card

                             Great User Experience
                             Easy to Read and Real URLs
                             Search Engine Friendly/Discoverability
                             Unique page titles for each tab
                             Unique Description and Keywords available

                             Don’t Break Back Button


Wednesday, September 5, 12
JS Tab Report Card

                             Great User Experience
                             Easy to Read and Real URLs
                             Search Engine Friendly/Discoverability
                             Unique page titles for each tab
                             Unique Description and Keywords available

                             Don’t Break Back Button


Wednesday, September 5, 12
JS Tab Report Card

                             Great User Experience
                             Easy to Read and Real URLs
                             Search Engine Friendly/Discoverability
                             Unique page titles for each tab
                             Unique Description and Keywords available

                             Don’t Break Back Button


Wednesday, September 5, 12
JS Tab Report Card

                             Great User Experience
                             Easy to Read and Real URLs
                             Search Engine Friendly/Discoverability
                             Unique page titles for each tab
                             Unique Description and Keywords available

                             Don’t Break Back Button


Wednesday, September 5, 12
JS Tab Report Card

                             Great User Experience
                             Easy to Read and Real URLs
                             Search Engine Friendly/Discoverability
                             Unique page titles for each tab
                             Unique Description and Keywords available

                             Don’t Break Back Button


Wednesday, September 5, 12
JS Tab Report Card

                             Great User Experience
                             Easy to Read and Real URLs
                             Search Engine Friendly/Discoverability
                             Unique page titles for each tab
                             Unique Description and Keywords available

                             Don’t Break Back Button


Wednesday, September 5, 12
JS Tab Report Card

                             Great User Experience
                             Easy to Read and Real URLs
                             Search Engine Friendly/Discoverability
                             Unique page titles for each tab
                             Unique Description and Keywords available

                             Don’t Break Back Button


Wednesday, September 5, 12
Level 3
           Let’s add that History thing William keeps talking about




Wednesday, September 5, 12
History API to the Rescue


                history.pushState(data,title, url)




Wednesday, September 5, 12
History API’d tab solution




Wednesday, September 5, 12
History API’d Tab Report Card

                             Great User Experience
                             Easy to Read and Real URLs
                             Search Engine Friendly/Discoverability
                             Unique page titles for each tab
                             Unique Description and Keywords available

                             Don’t Break Back Button


Wednesday, September 5, 12
History API’d Tab Report Card

                             Great User Experience
                             Easy to Read and Real URLs
                             Search Engine Friendly/Discoverability
                             Unique page titles for each tab
                             Unique Description and Keywords available

                             Don’t Break Back Button


Wednesday, September 5, 12
History API’d Tab Report Card

                             Great User Experience
                             Easy to Read and Real URLs
                             Search Engine Friendly/Discoverability
                             Unique page titles for each tab
                             Unique Description and Keywords available

                             Don’t Break Back Button


Wednesday, September 5, 12
History API’d Tab Report Card

                             Great User Experience
                             Easy to Read and Real URLs
                             Search Engine Friendly/Discoverability
                             Unique page titles for each tab
                             Unique Description and Keywords available

                             Don’t Break Back Button


Wednesday, September 5, 12
History API’d Tab Report Card

                             Great User Experience
                             Easy to Read and Real URLs
                             Search Engine Friendly/Discoverability
                             Unique page titles for each tab
                             Unique Description and Keywords available

                             Don’t Break Back Button


Wednesday, September 5, 12
History API’d Tab Report Card

                             Great User Experience
                             Easy to Read and Real URLs
                             Search Engine Friendly/Discoverability
                             Unique page titles for each tab
                             Unique Description and Keywords available

                             Don’t Break Back Button


Wednesday, September 5, 12
History API’d Tab Report Card

                             Great User Experience
                             Easy to Read and Real URLs
                             Search Engine Friendly/Discoverability
                             Unique page titles for each tab
                             Unique Description and Keywords available

                             Don’t Break Back Button


Wednesday, September 5, 12
Level 4
                             Put it all together!




Wednesday, September 5, 12
History API’d tab + Static Pages
               behind the fake urls solution




Wednesday, September 5, 12
History API Tab with Static Behnd

                             Great User Experience
                             Easy to Read and Real URLs
                             Search Engine Friendly/Discoverability
                             Unique page titles for each tab
                             Unique Description and Keywords available

                             Don’t Break Back Button


Wednesday, September 5, 12
History API Tab with Static Behnd

                             Great User Experience
                             Easy to Read and Real URLs
                             Search Engine Friendly/Discoverability
                             Unique page titles for each tab
                             Unique Description and Keywords available

                             Don’t Break Back Button


Wednesday, September 5, 12
History API Tab with Static Behnd

                             Great User Experience
                             Easy to Read and Real URLs
                             Search Engine Friendly/Discoverability
                             Unique page titles for each tab
                             Unique Description and Keywords available

                             Don’t Break Back Button


Wednesday, September 5, 12
History API Tab with Static Behnd

                             Great User Experience
                             Easy to Read and Real URLs
                             Search Engine Friendly/Discoverability
                             Unique page titles for each tab
                             Unique Description and Keywords available

                             Don’t Break Back Button


Wednesday, September 5, 12
History API Tab with Static Behnd

                             Great User Experience
                             Easy to Read and Real URLs
                             Search Engine Friendly/Discoverability
                             Unique page titles for each tab
                             Unique Description and Keywords available

                             Don’t Break Back Button


Wednesday, September 5, 12
History API Tab with Static Behnd

                             Great User Experience
                             Easy to Read and Real URLs
                             Search Engine Friendly/Discoverability
                             Unique page titles for each tab
                             Unique Description and Keywords available

                             Don’t Break Back Button


Wednesday, September 5, 12
History API Tab with Static Behnd

                             Great User Experience
                             Easy to Read and Real URLs
                             Search Engine Friendly/Discoverability
                             Unique page titles for each tab
                             Unique Description and Keywords available

                             Don’t Break Back Button


Wednesday, September 5, 12
Dude, um did you forget
                            IE again?!



Wednesday, September 5, 12
There’s a plugin for that




Wednesday, September 5, 12
Main Points to this
              • HTML5 History api is very valuable
              • We can now create ajax pages that have clean urls and
                is able to be search engine optimised
              • We made people happy!




Wednesday, September 5, 12
Whose Happy?




Wednesday, September 5, 12
Whose Happy?
                             Jeff the Designer is Happy!




Wednesday, September 5, 12
Whose Happy?
                             Jeff the Designer is Happy!



                                      Mr “SEO” Joe is happy!




Wednesday, September 5, 12
Whose Happy?
                             Jeff the Designer is Happy!



                                      Mr “SEO” Joe is happy!



           The Users of atlassian.com are Happy!



Wednesday, September 5, 12
Thanks for listening!



Wednesday, September 5, 12
Questions?



Wednesday, September 5, 12
Be sure to check out:
                                 Continuous Media Playback and
                                       RequireJS Modules
                                           David Pronk
                   David Pronk




Wednesday, September 5, 12

More Related Content

More from bkraft

Single sourcing desktop and mobile websites
Single sourcing desktop and mobile websitesSingle sourcing desktop and mobile websites
Single sourcing desktop and mobile websites
bkraft
 
Solr and Image Module Extensions of Magnolia
Solr and Image Module Extensions of MagnoliaSolr and Image Module Extensions of Magnolia
Solr and Image Module Extensions of Magnolia
bkraft
 
End to end content managed online mobile banking
End to end content managed online mobile bankingEnd to end content managed online mobile banking
End to end content managed online mobile banking
bkraft
 
Yet Another E-Commerce Integration: Magnolia Loves Hybris
Yet Another E-Commerce Integration: Magnolia Loves Hybris Yet Another E-Commerce Integration: Magnolia Loves Hybris
Yet Another E-Commerce Integration: Magnolia Loves Hybris
bkraft
 
Magnolia 5 Magnolia Conference 2012 Keynote
Magnolia 5 Magnolia Conference 2012 KeynoteMagnolia 5 Magnolia Conference 2012 Keynote
Magnolia 5 Magnolia Conference 2012 Keynote
bkraft
 

More from bkraft (20)

Magnolia Conference 2013: Keynote
Magnolia Conference 2013: KeynoteMagnolia Conference 2013: Keynote
Magnolia Conference 2013: Keynote
 
Webinar slides: Orchestrate Your Digital Channels with Magnolia 5
Webinar slides: Orchestrate Your Digital Channels with Magnolia 5Webinar slides: Orchestrate Your Digital Channels with Magnolia 5
Webinar slides: Orchestrate Your Digital Channels with Magnolia 5
 
Webinar - Why Magnolia 5 Rocks For IT
Webinar - Why Magnolia 5 Rocks For ITWebinar - Why Magnolia 5 Rocks For IT
Webinar - Why Magnolia 5 Rocks For IT
 
Increase Online Sales with Magnolia CMS' Shop Module
Increase Online Sales with Magnolia CMS' Shop ModuleIncrease Online Sales with Magnolia CMS' Shop Module
Increase Online Sales with Magnolia CMS' Shop Module
 
Virtual Presence Management at Magnolia Amplify Miami 2013
Virtual Presence Management at Magnolia Amplify Miami 2013Virtual Presence Management at Magnolia Amplify Miami 2013
Virtual Presence Management at Magnolia Amplify Miami 2013
 
High performance and scalability
High performance and scalability High performance and scalability
High performance and scalability
 
Multilingual websites, microsites and landing pages
Multilingual websites, microsites and landing pagesMultilingual websites, microsites and landing pages
Multilingual websites, microsites and landing pages
 
Blossom on the web
Blossom on the webBlossom on the web
Blossom on the web
 
Single sourcing desktop and mobile websites
Single sourcing desktop and mobile websitesSingle sourcing desktop and mobile websites
Single sourcing desktop and mobile websites
 
Work life balance
Work life balanceWork life balance
Work life balance
 
Solr and Image Module Extensions of Magnolia
Solr and Image Module Extensions of MagnoliaSolr and Image Module Extensions of Magnolia
Solr and Image Module Extensions of Magnolia
 
End to end content managed online mobile banking
End to end content managed online mobile bankingEnd to end content managed online mobile banking
End to end content managed online mobile banking
 
MBC Group - Magnolia in the Media
MBC Group - Magnolia in the MediaMBC Group - Magnolia in the Media
MBC Group - Magnolia in the Media
 
Yet Another E-Commerce Integration: Magnolia Loves Hybris
Yet Another E-Commerce Integration: Magnolia Loves Hybris Yet Another E-Commerce Integration: Magnolia Loves Hybris
Yet Another E-Commerce Integration: Magnolia Loves Hybris
 
Bridging the Gap: Magnolia Modules and Spring Configured Software
Bridging the Gap: Magnolia Modules and Spring Configured SoftwareBridging the Gap: Magnolia Modules and Spring Configured Software
Bridging the Gap: Magnolia Modules and Spring Configured Software
 
Enterprise Extensions to Magnolia's Imaging
Enterprise Extensions to Magnolia's ImagingEnterprise Extensions to Magnolia's Imaging
Enterprise Extensions to Magnolia's Imaging
 
How the STK, CSS & HTML and Rapid Prototyping Accelerate the Design Process
How the STK, CSS & HTML and Rapid Prototyping Accelerate the Design ProcessHow the STK, CSS & HTML and Rapid Prototyping Accelerate the Design Process
How the STK, CSS & HTML and Rapid Prototyping Accelerate the Design Process
 
Migros.ch - Modularizing Magnolia for Switzerland's Largest Retailer
Migros.ch - Modularizing Magnolia for Switzerland's Largest RetailerMigros.ch - Modularizing Magnolia for Switzerland's Largest Retailer
Migros.ch - Modularizing Magnolia for Switzerland's Largest Retailer
 
How AngryNerds Convinced Atlassian to Use Magnolia
How AngryNerds Convinced Atlassian to Use MagnoliaHow AngryNerds Convinced Atlassian to Use Magnolia
How AngryNerds Convinced Atlassian to Use Magnolia
 
Magnolia 5 Magnolia Conference 2012 Keynote
Magnolia 5 Magnolia Conference 2012 KeynoteMagnolia 5 Magnolia Conference 2012 Keynote
Magnolia 5 Magnolia Conference 2012 Keynote
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 

HTML5 History api to Ajaxify your Magnolia Website

  • 2. Know Your History(API) Using HTML5 History API to Ajaxify your Magnolia WebSite Wednesday, September 5, 12
  • 3. Agenda • The story of when I realized I needed to learn more about the history API • A stupidly simple example of the code in action • A walkthrough of our product tour redesign • How it works with magnolia Wednesday, September 5, 12
  • 4. About Me • William Paoli • Front End Web Developer • From San Francisco, California, USA • wpaoli@atlassian.com Wednesday, September 5, 12
  • 5. How we work together Interactive Marketing Team Designers and Web Developers Wednesday, September 5, 12
  • 6. How we work together Interactive Marketing Team Product Marketing Managers Designers and Web Developers Wednesday, September 5, 12
  • 7. How we work together Interactive Marketing Team Product Marketing Managers Demand Generation Designers and Web Developers Wednesday, September 5, 12
  • 8. The Website is our Salesperson Wednesday, September 5, 12
  • 9. The Atlassian Redesign We wanted to go from “This” to “This" August 2012 Wednesday, September 5, 12
  • 10. The Atlassian Redesign We wanted to go from “This” to “This" 1,800,000 Visits Wednesday, September 5, 12
  • 11. The Atlassian Redesign We wanted to go from “This” to “This" 4,006,000 Pageviews Wednesday, September 5, 12
  • 12. The Atlassian Redesign We wanted to go from “This” to “This" Wednesday, September 5, 12
  • 13. The Big Redesign Wednesday, September 5, 12
  • 14. The Concerns • SEO • Clean URLS • Clean UI • Great Performance Wednesday, September 5, 12
  • 15. The Concerns • SEO • Clean URLS • Clean UI • Great Performance Wednesday, September 5, 12
  • 26. Requirements of New Product Tour Great User Experience Easy to Read and Real URLs Search Engine Friendly/Discoverability Unique page titles for each tab Unique Description and Keywords available Don’t Break Back Button Wednesday, September 5, 12
  • 27. “DUDE, you are using the HISTORY API Right?” Wednesday, September 5, 12
  • 28. Of course I am, duh... Wednesday, September 5, 12
  • 29. Of course I am, duh... So uh...what’s the History API? Wednesday, September 5, 12
  • 31. window.history.length - returns the number of items window.history.go(n)- go forward/backward any number window.history.back()- go back window.history.forward()- go forward window.history.pushState(data, title, url) window.history.replaceState(data, title, url) Wednesday, September 5, 12
  • 32. window.history.length - returns the number of items window.history.go(n)- go forward/backward any number window.history.back()- go back window.history.forward()- go forward window.history.pushState(data, title, url) window.history.replaceState(data, title, url) Wednesday, September 5, 12
  • 33. window.history.length - returns the number of items window.history.go(n)- go forward/backward any number window.history.back()- go back window.history.forward()- go forward window.history.pushState(data, title, url) window.history.replaceState(data, title, url) Wednesday, September 5, 12
  • 35. history.pushState(data,title,url) {tabName:‘foo’} Adds to history.state Wednesday, September 5, 12
  • 36. history.pushState(data,title,url) {tabName:‘foo’} Currently Not Implemented Wednesday, September 5, 12
  • 37. history.pushState(data,title,url) {tabName:‘foo’} Used to modify window.location Wednesday, September 5, 12
  • 38. history.pushState(data,title,url) {tabName:‘foo’} AKA “Fake” URLS Wednesday, September 5, 12
  • 39. history.pushState(data,title,url); history.replaceState(data,title,url); Wednesday, September 5, 12
  • 40. history.pushState(data,title,url); history.replaceState(data,title,url); window.onpopstate = function(){} Wednesday, September 5, 12
  • 41. A useless example that hopefully illustrates how this works Wednesday, September 5, 12
  • 42. Level 1 Old Skool Style Wednesday, September 5, 12
  • 43. Demo of static tabs (reload each time) Wednesday, September 5, 12
  • 44. Static Site Report Card Great User Experience Easy to Read and Real URLs Search Engine Friendly/Discoverability Unique page titles for each tab Unique Description and Keywords available Don’t Break Back Button Wednesday, September 5, 12
  • 45. Static Site Report Card Great User Experience Easy to Read and Real URLs Search Engine Friendly/Discoverability Unique page titles for each tab Unique Description and Keywords available Don’t Break Back Button Wednesday, September 5, 12
  • 46. Static Site Report Card Great User Experience Easy to Read and Real URLs Search Engine Friendly/Discoverability Unique page titles for each tab Unique Description and Keywords available Don’t Break Back Button Wednesday, September 5, 12
  • 47. Static Site Report Card Great User Experience Easy to Read and Real URLs Search Engine Friendly/Discoverability Unique page titles for each tab Unique Description and Keywords available Don’t Break Back Button Wednesday, September 5, 12
  • 48. Static Site Report Card Great User Experience Easy to Read and Real URLs Search Engine Friendly/Discoverability Unique page titles for each tab Unique Description and Keywords available Don’t Break Back Button Wednesday, September 5, 12
  • 49. Static Site Report Card Great User Experience Easy to Read and Real URLs Search Engine Friendly/Discoverability Unique page titles for each tab Unique Description and Keywords available Don’t Break Back Button Wednesday, September 5, 12
  • 50. Static Site Report Card Great User Experience Easy to Read and Real URLs Search Engine Friendly/Discoverability Unique page titles for each tab Unique Description and Keywords available Don’t Break Back Button Wednesday, September 5, 12
  • 51. Level 2 Get Some jQuery up in there! Wednesday, September 5, 12
  • 52. JS tab solution Wednesday, September 5, 12
  • 53. JS Tab Report Card Great User Experience Easy to Read and Real URLs Search Engine Friendly/Discoverability Unique page titles for each tab Unique Description and Keywords available Don’t Break Back Button Wednesday, September 5, 12
  • 54. JS Tab Report Card Great User Experience Easy to Read and Real URLs Search Engine Friendly/Discoverability Unique page titles for each tab Unique Description and Keywords available Don’t Break Back Button Wednesday, September 5, 12
  • 55. JS Tab Report Card Great User Experience Easy to Read and Real URLs Search Engine Friendly/Discoverability Unique page titles for each tab Unique Description and Keywords available Don’t Break Back Button Wednesday, September 5, 12
  • 56. JS Tab Report Card Great User Experience Easy to Read and Real URLs Search Engine Friendly/Discoverability Unique page titles for each tab Unique Description and Keywords available Don’t Break Back Button Wednesday, September 5, 12
  • 57. JS Tab Report Card Great User Experience Easy to Read and Real URLs Search Engine Friendly/Discoverability Unique page titles for each tab Unique Description and Keywords available Don’t Break Back Button Wednesday, September 5, 12
  • 58. JS Tab Report Card Great User Experience Easy to Read and Real URLs Search Engine Friendly/Discoverability Unique page titles for each tab Unique Description and Keywords available Don’t Break Back Button Wednesday, September 5, 12
  • 59. JS Tab Report Card Great User Experience Easy to Read and Real URLs Search Engine Friendly/Discoverability Unique page titles for each tab Unique Description and Keywords available Don’t Break Back Button Wednesday, September 5, 12
  • 60. Level 3 Let’s add that History thing William keeps talking about Wednesday, September 5, 12
  • 61. History API to the Rescue history.pushState(data,title, url) Wednesday, September 5, 12
  • 62. History API’d tab solution Wednesday, September 5, 12
  • 63. History API’d Tab Report Card Great User Experience Easy to Read and Real URLs Search Engine Friendly/Discoverability Unique page titles for each tab Unique Description and Keywords available Don’t Break Back Button Wednesday, September 5, 12
  • 64. History API’d Tab Report Card Great User Experience Easy to Read and Real URLs Search Engine Friendly/Discoverability Unique page titles for each tab Unique Description and Keywords available Don’t Break Back Button Wednesday, September 5, 12
  • 65. History API’d Tab Report Card Great User Experience Easy to Read and Real URLs Search Engine Friendly/Discoverability Unique page titles for each tab Unique Description and Keywords available Don’t Break Back Button Wednesday, September 5, 12
  • 66. History API’d Tab Report Card Great User Experience Easy to Read and Real URLs Search Engine Friendly/Discoverability Unique page titles for each tab Unique Description and Keywords available Don’t Break Back Button Wednesday, September 5, 12
  • 67. History API’d Tab Report Card Great User Experience Easy to Read and Real URLs Search Engine Friendly/Discoverability Unique page titles for each tab Unique Description and Keywords available Don’t Break Back Button Wednesday, September 5, 12
  • 68. History API’d Tab Report Card Great User Experience Easy to Read and Real URLs Search Engine Friendly/Discoverability Unique page titles for each tab Unique Description and Keywords available Don’t Break Back Button Wednesday, September 5, 12
  • 69. History API’d Tab Report Card Great User Experience Easy to Read and Real URLs Search Engine Friendly/Discoverability Unique page titles for each tab Unique Description and Keywords available Don’t Break Back Button Wednesday, September 5, 12
  • 70. Level 4 Put it all together! Wednesday, September 5, 12
  • 71. History API’d tab + Static Pages behind the fake urls solution Wednesday, September 5, 12
  • 72. History API Tab with Static Behnd Great User Experience Easy to Read and Real URLs Search Engine Friendly/Discoverability Unique page titles for each tab Unique Description and Keywords available Don’t Break Back Button Wednesday, September 5, 12
  • 73. History API Tab with Static Behnd Great User Experience Easy to Read and Real URLs Search Engine Friendly/Discoverability Unique page titles for each tab Unique Description and Keywords available Don’t Break Back Button Wednesday, September 5, 12
  • 74. History API Tab with Static Behnd Great User Experience Easy to Read and Real URLs Search Engine Friendly/Discoverability Unique page titles for each tab Unique Description and Keywords available Don’t Break Back Button Wednesday, September 5, 12
  • 75. History API Tab with Static Behnd Great User Experience Easy to Read and Real URLs Search Engine Friendly/Discoverability Unique page titles for each tab Unique Description and Keywords available Don’t Break Back Button Wednesday, September 5, 12
  • 76. History API Tab with Static Behnd Great User Experience Easy to Read and Real URLs Search Engine Friendly/Discoverability Unique page titles for each tab Unique Description and Keywords available Don’t Break Back Button Wednesday, September 5, 12
  • 77. History API Tab with Static Behnd Great User Experience Easy to Read and Real URLs Search Engine Friendly/Discoverability Unique page titles for each tab Unique Description and Keywords available Don’t Break Back Button Wednesday, September 5, 12
  • 78. History API Tab with Static Behnd Great User Experience Easy to Read and Real URLs Search Engine Friendly/Discoverability Unique page titles for each tab Unique Description and Keywords available Don’t Break Back Button Wednesday, September 5, 12
  • 79. Dude, um did you forget IE again?! Wednesday, September 5, 12
  • 80. There’s a plugin for that Wednesday, September 5, 12
  • 81. Main Points to this • HTML5 History api is very valuable • We can now create ajax pages that have clean urls and is able to be search engine optimised • We made people happy! Wednesday, September 5, 12
  • 83. Whose Happy? Jeff the Designer is Happy! Wednesday, September 5, 12
  • 84. Whose Happy? Jeff the Designer is Happy! Mr “SEO” Joe is happy! Wednesday, September 5, 12
  • 85. Whose Happy? Jeff the Designer is Happy! Mr “SEO” Joe is happy! The Users of atlassian.com are Happy! Wednesday, September 5, 12
  • 88. Be sure to check out: Continuous Media Playback and RequireJS Modules David Pronk David Pronk Wednesday, September 5, 12