js achieve before the menu to keep the F5 key to refresh the page F5 to refresh the status, and monitor the child and the parent iframe page does not refresh

When using the menu layui achieve results, refresh the page again to the home state, the need to achieve a sub-page refresh iframe parent element does not refresh, here is the code

 // disable F5 to refresh when the default event 
     $ (the Document) .keydown (function ( Event ) {
           IF ( Event .keyCode == 116 ) {
               Event .preventDefault (); // Organization default refresh 
              right1.attr ( ' src ' , dataUrl); // refers to a sub-page the iframe the src 
          } 
      });

 

Guess you like

Origin www.cnblogs.com/lvxisha/p/11198728.html