Advertisement
Guest User

main.js

a guest
Apr 11th, 2013
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement