Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // JavaScript Document
- $( document ).ready(function() {
- $('.button').click(function(e) {
- e.preventDefault(); // Stops the browser from following the href in the <a>
- var that = $(this)
- , id = that.attr('id')
- , url = 'questions/' + id + '.html'
- ;
- $.post(url, function(data) {
- $('#replace').html(data); // Display external file to target div
- window.scrollTo(0, 0); // Forces a scroll back to the top of the page
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement