SlideShare uma empresa Scribd logo
1 de 11
Andrew Chalkley UI Developer
The Proper Way CSS Ye Olde Way Tables Obtrusive
CSS evangelists told us that there should be a separation  of layout from markup. JavaScript evangelists tell us today that there should be the separation of behavior from markup.
Bad <a href=“javascript:window.open(‘somepage.html’)”>Some Page</a> <a href=“#” onclick=“window.open(‘somepage.html’); return false;”>Some Page</a> Better <a href=“somepage.html” onclick=“window.open(‘somepage.html’); return false;”>...</a> Best <a href=“somepage.html” class=“new_window”>Some Page</a>
JavaScript Implementation window.onload = function() { } var anchors = document.getElementsByTagName(‘a’); 	for (vari = 0, anchor;  i <  anchors.length; i++) { 	} 		if (anchor.className ==  “new_window”) { anchor.onclick = function() { varhref = this.href; window.open(href); 				return false; 			} 		}
But wait… ,[object Object]
 it overrides any existing load or click handlers
 cannot handle class=“new_windowexternal_link”
 it leaks memory in IE6The Answer…
[object Object]
 Cross-browser support

Mais conteúdo relacionado

Mais procurados

The next step is... Bootstrap by Omar Qunsul
The next step is... Bootstrap by Omar QunsulThe next step is... Bootstrap by Omar Qunsul
The next step is... Bootstrap by Omar QunsulRails Girls MUC
 
From jQuery to App Store in 30 Minutes
From jQuery to App Store in 30 MinutesFrom jQuery to App Store in 30 Minutes
From jQuery to App Store in 30 Minutesedill3484
 
Building high-fidelity interactive prototypes with jQuery
Building high-fidelity interactive prototypes with jQueryBuilding high-fidelity interactive prototypes with jQuery
Building high-fidelity interactive prototypes with jQueryDavid Park
 
Burroughs_Tabitha_IgnitePresentationSlides
Burroughs_Tabitha_IgnitePresentationSlidesBurroughs_Tabitha_IgnitePresentationSlides
Burroughs_Tabitha_IgnitePresentationSlidestabithaburroughs
 
Standards.Next: Canvas
Standards.Next: CanvasStandards.Next: Canvas
Standards.Next: CanvasMartin Kliehm
 
Build an App with JavaScript and jQuery - LA - July 18 Pasadena
Build an App with JavaScript and jQuery - LA - July 18 PasadenaBuild an App with JavaScript and jQuery - LA - July 18 Pasadena
Build an App with JavaScript and jQuery - LA - July 18 PasadenaThinkful
 

Mais procurados (8)

The next step is... Bootstrap by Omar Qunsul
The next step is... Bootstrap by Omar QunsulThe next step is... Bootstrap by Omar Qunsul
The next step is... Bootstrap by Omar Qunsul
 
From jQuery to App Store in 30 Minutes
From jQuery to App Store in 30 MinutesFrom jQuery to App Store in 30 Minutes
From jQuery to App Store in 30 Minutes
 
Web performance101
Web performance101Web performance101
Web performance101
 
Building high-fidelity interactive prototypes with jQuery
Building high-fidelity interactive prototypes with jQueryBuilding high-fidelity interactive prototypes with jQuery
Building high-fidelity interactive prototypes with jQuery
 
MGT- CLUB
MGT- CLUB MGT- CLUB
MGT- CLUB
 
Burroughs_Tabitha_IgnitePresentationSlides
Burroughs_Tabitha_IgnitePresentationSlidesBurroughs_Tabitha_IgnitePresentationSlides
Burroughs_Tabitha_IgnitePresentationSlides
 
Standards.Next: Canvas
Standards.Next: CanvasStandards.Next: Canvas
Standards.Next: Canvas
 
Build an App with JavaScript and jQuery - LA - July 18 Pasadena
Build an App with JavaScript and jQuery - LA - July 18 PasadenaBuild an App with JavaScript and jQuery - LA - July 18 Pasadena
Build an App with JavaScript and jQuery - LA - July 18 Pasadena
 

Destaque

千呼萬喚始出來的Java SE 7
千呼萬喚始出來的Java SE 7千呼萬喚始出來的Java SE 7
千呼萬喚始出來的Java SE 7javatwo2011
 
Pimp your site with jQuery!
Pimp your site with jQuery!Pimp your site with jQuery!
Pimp your site with jQuery!Elliott Kember
 
使用Hudson打造屬於你自己的軟體建構機器人
使用Hudson打造屬於你自己的軟體建構機器人使用Hudson打造屬於你自己的軟體建構機器人
使用Hudson打造屬於你自己的軟體建構機器人javatwo2011
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotationjavatwo2011
 
Twiggy - let's get our widget on!
Twiggy - let's get our widget on!Twiggy - let's get our widget on!
Twiggy - let's get our widget on!Elliott Kember
 
What's Next in Growth? 2016
What's Next in Growth? 2016What's Next in Growth? 2016
What's Next in Growth? 2016Andrew Chen
 
32 Ways a Digital Marketing Consultant Can Help Grow Your Business
32 Ways a Digital Marketing Consultant Can Help Grow Your Business32 Ways a Digital Marketing Consultant Can Help Grow Your Business
32 Ways a Digital Marketing Consultant Can Help Grow Your BusinessBarry Feldman
 

Destaque (7)

千呼萬喚始出來的Java SE 7
千呼萬喚始出來的Java SE 7千呼萬喚始出來的Java SE 7
千呼萬喚始出來的Java SE 7
 
Pimp your site with jQuery!
Pimp your site with jQuery!Pimp your site with jQuery!
Pimp your site with jQuery!
 
使用Hudson打造屬於你自己的軟體建構機器人
使用Hudson打造屬於你自己的軟體建構機器人使用Hudson打造屬於你自己的軟體建構機器人
使用Hudson打造屬於你自己的軟體建構機器人
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotation
 
Twiggy - let's get our widget on!
Twiggy - let's get our widget on!Twiggy - let's get our widget on!
Twiggy - let's get our widget on!
 
What's Next in Growth? 2016
What's Next in Growth? 2016What's Next in Growth? 2016
What's Next in Growth? 2016
 
32 Ways a Digital Marketing Consultant Can Help Grow Your Business
32 Ways a Digital Marketing Consultant Can Help Grow Your Business32 Ways a Digital Marketing Consultant Can Help Grow Your Business
32 Ways a Digital Marketing Consultant Can Help Grow Your Business
 

Semelhante a jQuery SUG Group Introduction

Developing and testing ajax components
Developing and testing ajax componentsDeveloping and testing ajax components
Developing and testing ajax componentsIgnacio Coloma
 
jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009Ralph Whitbeck
 
Plone Interactivity
Plone InteractivityPlone Interactivity
Plone InteractivityEric Steele
 
10 Things You're Not Doing [IBM Lotus Notes Domino Application Development]
10 Things You're Not Doing [IBM Lotus Notes Domino Application Development]10 Things You're Not Doing [IBM Lotus Notes Domino Application Development]
10 Things You're Not Doing [IBM Lotus Notes Domino Application Development]Chris Toohey
 
Beautiful Java EE - PrettyFaces
Beautiful Java EE - PrettyFacesBeautiful Java EE - PrettyFaces
Beautiful Java EE - PrettyFacesLincoln III
 
jQuery for Sharepoint Dev
jQuery for Sharepoint DevjQuery for Sharepoint Dev
jQuery for Sharepoint DevZeddy Iskandar
 
Google Analytics: Measuring for results, a practical guide
Google Analytics: Measuring for results, a practical guideGoogle Analytics: Measuring for results, a practical guide
Google Analytics: Measuring for results, a practical guideMatter Solutions
 
Basics of Rich Internet Applications
Basics of Rich Internet ApplicationsBasics of Rich Internet Applications
Basics of Rich Internet ApplicationsSubramanyan Murali
 
J Query Presentation
J Query PresentationJ Query Presentation
J Query PresentationVishal Kumar
 
Discovery Education streaming and Google Earth
Discovery Education streaming and Google EarthDiscovery Education streaming and Google Earth
Discovery Education streaming and Google EarthMike Bryant
 
Wai Aria - An Intro
Wai Aria - An IntroWai Aria - An Intro
Wai Aria - An IntroMatt Machell
 
Scti 2011 minicurso jquery
Scti 2011 minicurso jqueryScti 2011 minicurso jquery
Scti 2011 minicurso jqueryciberglo
 

Semelhante a jQuery SUG Group Introduction (20)

Developing and testing ajax components
Developing and testing ajax componentsDeveloping and testing ajax components
Developing and testing ajax components
 
jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009
 
Plone Interactivity
Plone InteractivityPlone Interactivity
Plone Interactivity
 
10 Things You're Not Doing [IBM Lotus Notes Domino Application Development]
10 Things You're Not Doing [IBM Lotus Notes Domino Application Development]10 Things You're Not Doing [IBM Lotus Notes Domino Application Development]
10 Things You're Not Doing [IBM Lotus Notes Domino Application Development]
 
Html5
Html5Html5
Html5
 
GWT
GWTGWT
GWT
 
EPiServer Web Parts
EPiServer Web PartsEPiServer Web Parts
EPiServer Web Parts
 
Beautiful Java EE - PrettyFaces
Beautiful Java EE - PrettyFacesBeautiful Java EE - PrettyFaces
Beautiful Java EE - PrettyFaces
 
jQuery for Sharepoint Dev
jQuery for Sharepoint DevjQuery for Sharepoint Dev
jQuery for Sharepoint Dev
 
Google Analytics: Measuring for results, a practical guide
Google Analytics: Measuring for results, a practical guideGoogle Analytics: Measuring for results, a practical guide
Google Analytics: Measuring for results, a practical guide
 
Basics of Rich Internet Applications
Basics of Rich Internet ApplicationsBasics of Rich Internet Applications
Basics of Rich Internet Applications
 
J Query Presentation
J Query PresentationJ Query Presentation
J Query Presentation
 
Merb jQuery
Merb jQueryMerb jQuery
Merb jQuery
 
Discovery Education streaming and Google Earth
Discovery Education streaming and Google EarthDiscovery Education streaming and Google Earth
Discovery Education streaming and Google Earth
 
Front End on Rails
Front End on RailsFront End on Rails
Front End on Rails
 
Ajax
AjaxAjax
Ajax
 
Jquery 1
Jquery 1Jquery 1
Jquery 1
 
Wai Aria - An Intro
Wai Aria - An IntroWai Aria - An Intro
Wai Aria - An Intro
 
Mobile web with jQuery Mobile
Mobile web with jQuery MobileMobile web with jQuery Mobile
Mobile web with jQuery Mobile
 
Scti 2011 minicurso jquery
Scti 2011 minicurso jqueryScti 2011 minicurso jquery
Scti 2011 minicurso jquery
 

Mais de Andrew Chalkley

Best Practices for Testing Open Source Projects
Best Practices for Testing Open Source ProjectsBest Practices for Testing Open Source Projects
Best Practices for Testing Open Source ProjectsAndrew Chalkley
 
Hardware Hacking for Thrify, Modern JavaScript Developers
Hardware Hacking for Thrify, Modern JavaScript DevelopersHardware Hacking for Thrify, Modern JavaScript Developers
Hardware Hacking for Thrify, Modern JavaScript DevelopersAndrew Chalkley
 
What I've Learned Developing for iOS
What I've Learned Developing for iOSWhat I've Learned Developing for iOS
What I've Learned Developing for iOSAndrew Chalkley
 
Building iPhone/Andriod Apps with Titanium Appcelerator for a Rails Backend
Building iPhone/Andriod Apps with Titanium Appcelerator for a Rails BackendBuilding iPhone/Andriod Apps with Titanium Appcelerator for a Rails Backend
Building iPhone/Andriod Apps with Titanium Appcelerator for a Rails BackendAndrew Chalkley
 

Mais de Andrew Chalkley (6)

Best Practices for Testing Open Source Projects
Best Practices for Testing Open Source ProjectsBest Practices for Testing Open Source Projects
Best Practices for Testing Open Source Projects
 
Hardware Hacking for Thrify, Modern JavaScript Developers
Hardware Hacking for Thrify, Modern JavaScript DevelopersHardware Hacking for Thrify, Modern JavaScript Developers
Hardware Hacking for Thrify, Modern JavaScript Developers
 
What I've Learned Developing for iOS
What I've Learned Developing for iOSWhat I've Learned Developing for iOS
What I've Learned Developing for iOS
 
Ruby On Rails Ecosystem
Ruby On Rails EcosystemRuby On Rails Ecosystem
Ruby On Rails Ecosystem
 
Building iPhone/Andriod Apps with Titanium Appcelerator for a Rails Backend
Building iPhone/Andriod Apps with Titanium Appcelerator for a Rails BackendBuilding iPhone/Andriod Apps with Titanium Appcelerator for a Rails Backend
Building iPhone/Andriod Apps with Titanium Appcelerator for a Rails Backend
 
Spring Integration
Spring IntegrationSpring Integration
Spring Integration
 

Último

Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 

Último (20)

Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 

jQuery SUG Group Introduction

  • 1. Andrew Chalkley UI Developer
  • 2. The Proper Way CSS Ye Olde Way Tables Obtrusive
  • 3. CSS evangelists told us that there should be a separation of layout from markup. JavaScript evangelists tell us today that there should be the separation of behavior from markup.
  • 4. Bad <a href=“javascript:window.open(‘somepage.html’)”>Some Page</a> <a href=“#” onclick=“window.open(‘somepage.html’); return false;”>Some Page</a> Better <a href=“somepage.html” onclick=“window.open(‘somepage.html’); return false;”>...</a> Best <a href=“somepage.html” class=“new_window”>Some Page</a>
  • 5. JavaScript Implementation window.onload = function() { } var anchors = document.getElementsByTagName(‘a’); for (vari = 0, anchor; i < anchors.length; i++) { } if (anchor.className == “new_window”) { anchor.onclick = function() { varhref = this.href; window.open(href); return false; } }
  • 6.
  • 7. it overrides any existing load or click handlers
  • 8. cannot handle class=“new_windowexternal_link”
  • 9. it leaks memory in IE6The Answer…
  • 10.
  • 12. Compatibility mode (DWR, Prototype, etc)
  • 13. Executes when DOM is ready (before images have loaded)
  • 14.
  • 15. window.onload = function() { } var anchors = document.getElementsByTagName(‘a’); for (vari = 0, anchor; i < anchors.length; i++) { } if (anchor.className == “new_window”) { anchor.onclick = function() { varhref = this.href; window.open(href); return false; } }
  • 16. $(function() { }); $(“a.new_window”).click(function() { }); window.open( $(this).attr(“href”) ); return false;
  • 17. DEMO