Created
December 21, 2010 18:53
-
-
Save ltackett/750364 to your computer and use it in GitHub Desktop.
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
| // class and rel for grabbing a file and printing it inline via AJAX | |
| var ajaxme = function(container, source){ | |
| $.ajax({ | |
| url: source, | |
| success: function(data){ | |
| container.text(data); | |
| }, | |
| error: function(){ | |
| container.html('File Not Found.') | |
| } | |
| }) | |
| } | |
| $('.ajax-me').each(function(){ | |
| if ($(this).find('pre').hasClass('result') != true){ | |
| $(this).append('<pre class="result"></pre>') | |
| var container = $(this).find('pre'); | |
| var source = $(this).attr('rel'); | |
| ajaxme(container, source); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment