Home > front end >  Js function trigger condition how to set up as a js function
Js function trigger condition how to set up as a js function

Time:04-21

The background is like that, I want to write a js script, because a site is always pop up one thing to let a person very vexed
Pop up logic is a js function. Through the append added some HTML element
 function AppendWarningHtml () {
If ($(" # dvWarningView ".) length & lt;=0) {
Var a="& lt; Div class="playgoon 'id=' dvWarningView '& gt;
";
"DocumentKnowledge==knowledgeType?" $(" # docplayercontainer "). Append (a) : ($(" # playervideocontainer "), append (a),
$(" # playeraudiocontainer "). Append (a),
$(" # playercontainer "). Append (a)),
"VideoKnowledge==" knowledgeType & amp; & Void 0!==myPlayer & amp; & "Playing"==myPlayer. GetState ()? MyPlayer. Pause () : clearInterval (timer)
}
}

Can want to write a js function after this function call direct call RemoveWarningHtml () avoid trouble

CodePudding user response:

To write pop-up js method to reset to empty
Hide to append the dom directly

CodePudding user response:

reference 1st floor jio can reply:
write pop-up js, the reset to empty
Hidden directly to append the dom

But the problem is that the code above is the site of the original code, every time I could not open the website also to change the code
And the other pages of this site have this code

CodePudding user response:

Or can be modified by means of external js function coding an already existing content of js function

CodePudding user response:

If you look at the function can modify is global, where mount, Windows or other internal attributes

CodePudding user response:

reference 5 floor jio can reply:
if it is a global can modify, see where function mount, Windows or other internal attribute

If I changed it, when I visit the other pages of this site will take effect? Or will only take effect in this page?

CodePudding user response:

Browser installed an advertisement interception plug-in directly set dom is ok, don't need to write their own script

CodePudding user response:

reference 7 floor jio response:
browser installed an advertisement interception plug-in directly set dom is ok, what do not need to write their own script

I wrote a every once in a while to detect a script, but think it's silly, carried out a lot of unnecessary number, so can ask about optimizing
Can is binding a js function to trigger condition for another js function to perform

CodePudding user response:

The modal window function is generally global general, this function can influence all pages using the reset,
  • Related