Skip to content

Instantly share code, notes, and snippets.

@gtallen1187
Created August 1, 2014 07:47
Show Gist options
  • Save gtallen1187/e3cef92fa23994da952d to your computer and use it in GitHub Desktop.
Save gtallen1187/e3cef92fa23994da952d to your computer and use it in GitHub Desktop.
two ways to append a stylesheet reference to the head
//
// Script for adding external CSS stylesheet to DXP
//
var myStylesLocation = 'http://www.ecwincentives.com/assets/css/bootstrap.min.css'
$('<link rel="stylesheet" type="text/css" href="'+myStylesLocation+'" >')
.appendTo("head");
//
// Alternate way to add css resource
//
//add css to head
$("<link/>", { "rel": "stylesheet", "type": "text/css", "href": "https://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/css/jquery.dataTables.css" }).appendTo("head");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment