Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mobile Web Performance Optimization

You're reading from   Mobile Web Performance Optimization Deliver a better mobile user experience by improving and optimizing your website – follow these practical steps for cutting-edge application development

Arrow left icon
Product type Paperback
Published in Dec 2015
Publisher
ISBN-13 9781785289972
Length 150 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
S. S. Niranga S. S. Niranga
Author Profile Icon S. S. Niranga
S. S. Niranga
Arrow right icon
View More author details
Toc

Table of Contents (9) Chapters Close

Preface 1. Pillars of Mobile Web Performance Optimization 2. Mobile Web Optimization Essentials FREE CHAPTER 3. How to Optimize Your Mobile Website 4. Caching and Optimizing 5. Monitoring and Debugging Our Website 6. Managing Third-Party Components 7. Tips and Tricks Index

Empty source and link attributes


If we have an HTML tag containing an attribute, without value, we say it is an empty attribute. The issue with this empty attribute is, if the empty attribute is a source or a link, some browsers will still try to connect to the server, even we set it as an empty value. This unwanted request and overhead will create delays in our mobile website or application. As an example, take a look at the following anchor tag and image tag:

<a href="">
<img src="">

Also, take a look at the following JavaScript code:

var image = new Image();
image.src = ""

Usually, the HTML recommendation is that if there is an src attribute, it should contain a URL. However, if you are using HTML5, you can have an empty attribute because, HTML5 uses specified algorithm to avoid extra requests if there is an empty attribute.

But, if you are not using HTML5 different browsers will behave differently:

  • Some browsers make the request to the same page

  • Some browsers ignore the request...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image