Tuesday, March 8, 2016

Drink from an iFrame with jQuery and make a button disabled with a tooltip too!

If "refreshme" is the id attribute on the iFrame tag...

$(function () {
   listenForLogoChange();
});
function listenForLogoChange() {
   var listener = function () {
      var backingstorewrapper = $("#refreshme").contents().find("#IsChanged")[0];
      var backingstore = $(backingstorewrapper).val();
      if (backingstore === "true") {
         $("#EmailTriggerTest").attr("disabled", "disabled");
         $("#EmailTriggerTest").attr("title", "Logo changes must be saved before they may
               be tested.");
      }
   }
   var interval = setInterval(listener, 100);
}

 
 

Word!

No comments:

Post a Comment