Want more features on Pastebin? Sign Up, it's FREE!
Guest

main.js

By: a guest on Apr 11th, 2013  |  syntax: JavaScript  |  size: 0.83 KB  |  views: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. $(document).ready(function() {
  2.     "use strict";
  3.  
  4.     //Update the feed
  5.     $("a.feedName").click(function(e) {
  6.         e.preventDefault();
  7.         var feedURL;
  8.         feedURL = $(this).attr("href");
  9.         $.ajax('model/RSSFeed.php', {
  10.             data: {url: feedURL},
  11.             beforeSend: function() {
  12.                 $("#feedBody").html("<div class=\"alert alert-info span7\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button><strong>Loading Feed&hellip;</strong>");
  13.             },
  14.             cache: false,
  15.             success: function(result) {
  16.                 $("#feedBody").html(result);
  17.                 alert(result);
  18.             },
  19.             error: function(result) {
  20.                 $("#feedBody").hide();
  21.                 alert("Error!");
  22.             }
  23.         });
  24.     });
  25. });
clone this paste RAW Paste Data