JQuery's method for controlling frames and frame page JS, jqueryframes
This article describes how jQuery controls frames and frame page JS. We will share this with you for your reference. The details are as follows:
<Script src = "jquery-1.3.2.min.js" type = "text/javascript"> </script> <script> var _ intervalx, steplengthxsteplengthx = 1000; // nextstepx = 10000; // future trigger time $ (document ). ready (function () {_ intervalx = setInterval ("CheckUser ()", steplengthx) ;}); function CheckUser () // send the lookup program {if (parent. frames ["frmMain"]. location. pathname! = "/SysMan/user_agent.asp") // if it is on the user_agent.asp page, no prompt {$. post (".. /webchat/chat. asp ", {" action ":" checkuser "}, function (data) // initialize the message {if (parseInt (data)> 0) // {if ($ (window. parent. frames ["frmMain" example .doc ument ). find ("# message "). length <1) // If the page has been added, {var messages = "<div id = message> <ul> <li> A new customer sends a customer service application. </li> <a href = .. /SysMan/user_agent.asp target = _ self> online customer service </a> </li> </ul> </div> "}$ (window. parent. frames ["frmMain" example .doc ument ). find ("body "). append (messages) $ (window. parent. frames ["frmMain" example .doc ument ). find ("# message "). show (); TimeOut () ;}}); clearInterval (_ intervalx); _ intervalx = setInterval ("CheckUser ()", nextstepx);} function TimeOut () {setTimeout (function () {$ (window. parent. frames ["frmMain" example .doc ument ). find ("# message "). hide ("slow") ;}, 5000) // close in 3 seconds} </script>