Stripping all types of style before displaying .load() content

Stripping all types of style before displaying .load() content

Hi all.

I'm making a quick and dirty Google Calendar displayer with help from Full Calendar and am struggling to display the details of each Google event correctly.  As you may know, if you're not logged into Google Calendar, if you're given an event link or invitation you will be taken to a dynamically generated page displaying the basic details of that event.  It includes a <link>ed stylesheet and inline style="..." for each element.  I have attached a screenshot of a typical event page.

I'm trying to strip out all the style and just display the content:

  1. eventClick: function(event) {
  2. if (event.url) {
  3.   $("#details").hide().load(event.url);
  4.   $("#details *").each(function(){
  5.     $(this).attr("style", "");
  6.     });
  7.    $("#details").show();
  8.    return false;
  9.   }
  10. }
Of course, this isn't working.  So what am I doing wrong?  How can I change my function to delete the <link> element BEFORE the stylesheet is loaded into memory?

As an aside, you'll notice I'm load() -ing a variable called event.url instead of a string so can't use standard notation to import an HTML fragment.  Damn.