Created
September 1, 2020 17:48
-
-
Save eclarrrk/a8c3df3ee42ce8d73a647503d425114f to your computer and use it in GitHub Desktop.
Display the contents of a text-based file on a page using jQuery
This file contains 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
<p>Get the contents of <code>/wp-content/themes/webguard-ra-theme/sass/typography/_font-size.scss</code></p> | |
<pre class="has-small-font-size" id="myelement"></pre> | |
Using this code: | |
<pre class="has-small-font-size"> | |
$( document ).ready(function() { | |
jQuery.get("/wp-content/themes/webguard-ra-theme/sass/typography/_font-size.scss", undefined, function(data) { | |
$('#myelement').append(data); | |
}, "html"); | |
});</pre> | |
<script> | |
$( document ).ready(function() { | |
jQuery.get("/wp-content/themes/webguard-ra-theme/sass/typography/_font-size.scss", undefined, function(data) { | |
$('#myelement').append(data); | |
}, "html"); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment