I personally have never pulled in a page like that, but I do something like
below:

/*
* @example
* loadPageViews('theurl.htm', function(){anyfunction();}, '#whattoremove,
'#whattoappendto');
* @desc loads an element/view and removes an element and appends to
* another element the return value.
*
* This is a modified version, it will allow for passing multiple
* functions at a time.
*
* @name loadPageViews
* @type function
* @param String view // view to pull in, must be set in view.js
* @param String func // function to get executed on success
* @param String getsremove // item to be removed from dom
* @param String toappend // item to be appended to in dom
*/
loadPageViews = function(strUrl, func, getsremove, toappend){
   try{
       $.ajax({
              type:         "GET",
              url:            strUrl,
              dataType:    "html",
              error: function(){$.iLogger.log(arguments[2],'error',
'loadPageViews()');},
              async : false,
              success: function(){
                   if(getsremove){$(getsremove).remove();}
                   if(toappend){$(toappend).append(arguments[0]);}
                   else{$('body').append(arguments[0]);}
                   if(func){func();}
               }
          });
   }
   catch(e){
   }
};    // end: loadPageViews();

in the success part I pass in code that will do some altering or add click
events.  Hopefully this points you in the right direction.

--
Benjamin Sterling
http://www.KenzoMedia.com
http://www.KenzoHosting.com

Reply via email to