Unobtrusive JavaScript – What is it?

I came across this concept while reading “JQuery in Action”. I am on chapter 1 and the language and explanations given are excellent. (i.e. once can easily understand)

My understanding for it is:

It is a way to separate the behavior from the structure. Instead of clubbing the event behavior within HTML tags, we can use JQuery selectors to select the HTML element and apply the event behavior through script.

According to the principles of  Unobtrusive JavaScript:

“Any JavaScript expressions or statements embedded in the <body> of
HTML pages, either as attributes of HTML elements (such as onclick) or in script
blocks placed within the body of the page, are considered as correct.”

 

Unobtrusive JavaScript, though a powerful technique to further add to the
clear separation of responsibilities within a web application, doesn’t come without
its price. Unobtrusive JavaScript not only may increase the amount of script that needs to be written, but also requires some discipline and the application of good coding patterns to the client-side script.

Thoughts on Life, Events and Current Happenings
Sandeep Joshi
Enterprise Innovations| Leadership Advisory | Agile & DevOps Practitioner | Microsoft & MVP Alumni
Business and technology transformation leader with a successful track record of building high growth engineering organisations, advising executive leaders on scaling innovations, creating business and technology levers and ecosystem development.

🖌 Specialise in defining organisation operating model, transformation road-map, leadership advisory and technology rollout plans for end to end delivery (inception to operation)

🖌 Delivered multiple large-scale transformation program with impactful outcomes across APAC at various industry verticals collaborating with Sales, Marketing, Finance, HR etc.

🖌 Centre of Excellence setup for Blockchain, Cognitive, Robotics, Cloud, AI and Quantum computing across APAC and US for various clients

🖌 Over a decade of experience in setting up Global Delivery Centres and Consulting Practices in multiple organisations

🖌 Author, Speaker and Technical Community Evangelist – 7 times Microsoft Most Valuable Professional and Active contributor

#Interests

IT Strategy | Innovation | Design thinking
Agile transformations | Coaching | Building High Performing Teams
DevOps | Continuous delivery | Application Lifecycle
AI | Cognitive Computing | IOT | RPA | Quantum Computing
Lean Product Management | Program Management
IT Leadership | Strategy | Innovation | Mentoring
High Scale Enterprise Architecture | API Development
Cloud Computing (Azure, AWS, Private Cloud)
Containers | Microservices | Test Automation
Data Analytics | Machine Learning | Cognitive
Audit, Compliance and Data Privacy (SOX, PCI)

Share this:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.