The following code loads the html content from a file (I used this stream )
<script> $.fn.loadWithoutCache = function (){ $.ajax({ url: arguments[0], cache: false, dataType: "html", success: function(data) { $(this).html(data); </script>
Please let me know what is the problem? Hope this is something stupid :)
Edit: CORRECT CODE
<script> $(document).ready(function() { $.fn.loadWithoutCache = function (){ var $el = $(this); $.ajax({ url: arguments[0], cache: false, dataType: "html", context: this, success: function(data) { $el.html(data); } }); } $('#result').loadWithoutCache('page.html'); }); </scipt>
Thanks John and thatβs it!
source share