forked from louisho5/jQuery-Include-HTML-File-Plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjquery.includeHTML.min.js
1 lines (1 loc) · 1.04 KB
/
jquery.includeHTML.min.js
1
!function(a){jQuery.fn.loadHTML=function(b){var c=this;a.ajax({type:"GET",url:b,dataType:"text",success:function(b){a(c).html(b)},error:function(a){console.log(a.message)}})},jQuery.fn.appendHTML=function(b){var c=this;a.ajax({type:"GET",url:b,dataType:"text",success:function(b){a(c).append(b)},error:function(a){console.log(a.message)}})},jQuery.fn.prependHTML=function(b){var c=this;a.ajax({type:"GET",url:b,dataType:"text",success:function(b){a(c).prepend(b)},error:function(a){console.log(a.message)}})},jQuery.fn.loadTEXT=function(b){var c=this;a.ajax({type:"GET",url:b,dataType:"text",success:function(b){a(c).text(b)},error:function(a){console.log(a.message)}})},jQuery.fn.appendTEXT=function(b){var c=this;a.ajax({type:"GET",url:b,dataType:"text",success:function(b){a(c).append(document.createTextNode(b))},error:function(a){console.log(a.message)}})},jQuery.fn.prependTEXT=function(b){var c=this;a.ajax({type:"GET",url:b,dataType:"text",success:function(b){a(c).prepend(document.createTextNode(b))},error:function(a){console.log(a.message)}})}}(jQuery);