jquery.load remote url via data attribute

<div class="loadContent" data-joburl="pageurl.php">Click</div> <div class="content"></div> <script> $(document).ready(function(){ $(".loadConent").click(function () { var job_form = $(this).data("joburl"); $( ".content" ).load(job_form + ' .load-data'); }); }); </script>
This snippet loads content from a remote URL inside of a class named "load-data", into a div called "content", using an attribute value called "joburl"

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.