Created
January 29, 2013 09:23
-
-
Save henrahmagix/4662962 to your computer and use it in GitHub Desktop.
Verbose method to build HTML using jQuery. No more insanely long strings!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Found at http://usejquery.com/posts/the-jquery-cross-domain-ajax-guide. | |
// Modified to remove undefined variables. Docs at http://api.jquery.com/jQuery/#jQuery2 | |
jQuery('<li/>', { //build an li element | |
html: jQuery('<a/>', { //with an A element inside it | |
href: 'http://henrahmagix.github.com', //set the href for the link | |
text: 'Henrahmagix On GitHub' //and the text | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment