Skip to main content
100%

$.loadTmpl

✓ Published0🌍 Public
Aabernier
Last edited Aug 13, 2011
Created on Aug 13, 2011

This example demonstrates a lightweight jQuery plugin that loads an external HTML template and injects it into the document head as a script tag with a custom type. It uses the jQuery `$.get` method to fetch the template content, then appends it using the `$("head").append()` API. The plugin assigns the template a user-specified id and type `text/template`, making it available for client-side rendering without executing the content. The code shows a simple, reusable pattern for loading templates dynamically, relying on jQuery’s AJAX and DOM manipulation functions.

AI-generated description

Similar vizzes