search
HomeWeb Front-endJS TutorialJavascript function packing is mostly used for event binding_js object-oriented


[Ctrl A select all Note: If you need to introduce external Js, you need to refresh to execute
]<script> function addShell(func,name,obj) { func=Function(func); if(!obj) obj=window; var old = obj[name]; if (typeof obj[name] != 'function') { obj[name] = func; } else { obj[name] = function() { var ja=[]; var t = obj[name].arguments; for(var x=0;x<t.length;x++) ja.push(t[x]); old.apply(null,ja); func.apply(null,ja); } } } //--测试代码开始-- addShell('alert(arguments[0]+":"+arguments[1]+":"+arguments[2])',"aaa"); addShell('alert(arguments[0]+":"+arguments[1]+":"+arguments[2])',"aaa"); addShell('alert(arguments[0]+":"+arguments[1]+":"+arguments[2])',"aaa"); addShell('alert(arguments[0]+":"+arguments[1]+":"+arguments[2])',"aaa"); addShell('alert(arguments[0]+":"+arguments[1]+":"+arguments[2])',"aaa"); addShell('aaa("1111","3333","5555")',"onload"); addShell('aaa("1","3","5")',"onload"); //--测试代码结束-- </script>
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
jquery绑定事件有几种方式?jquery绑定事件有几种方式?Nov 09, 2020 pm 03:30 PM

jquery绑定事件有4种方式,分别为:bind()、live()、delegate()和on()方法;其中bind()方法只能针对已经存在的元素进行事件的绑定,而live()、on()、delegate()均支持未来新添加元素的事件绑定。

解决UniApp报错:'xxx'事件未绑定的问题解决UniApp报错:'xxx'事件未绑定的问题Nov 25, 2023 am 10:56 AM

在使用UniApp开发应用时,可能会遇到以下错误提示:'xxx'事件未绑定。这是由于UniApp的事件绑定机制导致的,需要正确设置才能解决该问题。一、问题原因在UniApp中,页面组件的事件绑定是通过v-on指令完成的。例如,在模板中添加一个按钮组件:&lt;button@click=&quot;onClick&quot;&gt;点击我&lt;/butto

Vue应用中遇到"click"事件绑定无效怎么办?Vue应用中遇到"click"事件绑定无效怎么办?Jun 24, 2023 pm 03:51 PM

Vue是一款流行的JavaScript框架,用于构建现代的Web应用程序。在Vue中,我们通常使用指令来实现DOM元素的操作。其中,"click"事件是常用的一个指令之一,然而,在Vue应用程序中,我们经常会遇到"click"事件绑定无效的情况。本文将介绍解决这一问题的方法。检查元素是否存在第一步是确认要绑定"click"事件的元素是否存在。如果元素不存在,

怎么给元素添加事件?JS绑定事件三种方式解析怎么给元素添加事件?JS绑定事件三种方式解析Aug 04, 2022 pm 07:27 PM

javascript作为脚本语言, 可以为页面上的元素绑定事件,用于在指定事件发生时能自动调用相应的事件处理程序处理事件。那么怎么给元素添加事件?下面本篇文章给大家介绍一下JS绑定事件三种方式,希望对大家有所帮助!

深度探讨jQuery事件绑定技术深度探讨jQuery事件绑定技术Feb 26, 2024 pm 07:36 PM

jQuery是一种流行的JavaScript库,被广泛用于处理Web页面的交互性。其中,事件绑定是jQuery的重要功能之一,通过事件绑定可以实现对用户交互操作的响应。本文将探讨jQuery事件绑定技术,并给出具体的代码示例。一、事件绑定的基本概念事件绑定是指在DOM元素上添加事件监听器,以便在特定事件发生时执行指定的操作。在jQuery中,通过选择器选中需

jquery绑定事件有什么作用jquery绑定事件有什么作用Mar 20, 2023 am 10:52 AM

jquery绑定事件的作用:将普通的事件event绑定在DOM节点上,当DOM节点被选中时,将事件与之绑定,方便用户提供相应的操作。jQuery中提供了四种事件绑定方式,分别是bind、live、delegate、on,对应的解除监听的函数分别是unbind、die、undelegate、off。

深入剖析jQuery事件绑定技巧深入剖析jQuery事件绑定技巧Feb 26, 2024 pm 06:33 PM

jQuery是一种流行的JavaScript库,它简化了网页开发中的许多常见任务,其中包括元素选择、DOM操作和事件处理。在jQuery中,事件绑定是非常常见和重要的操作之一。本文将详细探讨jQuery中事件绑定的方法,并通过具体的代码示例来帮助读者更好地理解和应用这些方法。1.bind()方法bind()方法是最传统也是最常用的事件绑定方法之一。它可

Vue文档中的事件绑定函数参数的使用方法Vue文档中的事件绑定函数参数的使用方法Jun 20, 2023 pm 02:06 PM

Vue是一个流行的JavaScript框架,它采用了数据驱动的思想来简化开发流程。Vue的事件绑定功能是非常强大的,可以对页面中的各种交互进行处理。在Vue的开发过程中,经常会使用到事件绑定函数参数,本文将详细介绍这个功能的使用方法。在Vue中,可以使用v-on指令来绑定事件。v-on指令后面跟着事件名和事件处理函数,例如:&lt;bu

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)