IE title changes to if the page has a url with '#' , and has flash/swf embedded in it

后端 未结 5 804

The issue is, if IE (6.0+) , has flash content embedded in it, and the url of the page has a # somewhere in it, then when the flash content loads ,or if the user interacts with

5条回答
  •  悲&欢浪女
    2021-01-31 10:22

    I'm a little late to the party but I prefer this approach:

    var originalTitle = document.title;
    
    copyLinkClipboard = new ZeroClipboard(document.getElementById('copy-link-btn'));
    
    copyLinkClipboard.on( 'ready', function () {
      copyLinkClipboard.on( 'aftercopy', function (event) {
        event.target.blur();
        console.log('Successfully copied link to your clipboard!');
        document.title = originalTitle; // sets the title back on successful copy
      });
    });
    
    document.title = originalTitle; // sets title back when it changes on instantiation
    

    This specifically changes the title back in the two events that ZeroClipboard changes it, rather than registering a listener on the document.onpropertychange event.

提交回复
热议问题