Load Only a Section of a Page

Use Case

You want to AJAX load a section of another page on your site onto the current page. Say your eCommerce CMS system creates a dynamic menu of products, but that exists as a subdirectory of your site and …

Avatar of Chris Coyier
Chris Coyier on

Active Gzip Compression

Compression reduces response times by reducing the size of the HTTP response. Gzip is the most popular and effective compression method currently available and generally reduces the response size by about 70%.

In 2009, 90% of internet traffic travelled through …

Avatar of Chris Coyier
Chris Coyier on (Updated on )

Working with Attributes

Setting Single Attribute

$("img").attr("src", "/images/banner.jpg");

Setting Single Attribute (with function)

$("div").attr("id", function (arr) {
    return "div-id" + arr;
})

Setting Multiple Attributes

$("img").attr({
       src: "/images/banner.jpg",
       title: "banner",
       alt: "banner"
});

Getting Attribute

var $source = $("img").attr("src");
Avatar of Chris Coyier
Chris Coyier on

New Snippets Feed & How-To

There is a new snippets-only feed! This will always remain it’s own separate feed I think, and not be a part of the main feed. Mostly because I hope that the snippets will grow and grow and there will hopefully …

Avatar of Chris Coyier
Chris Coyier on

Typography Test

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies1 eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat …

Avatar of Chris Coyier
Chris Coyier on (Updated on )