


JavaScript custom function parameters are passed in string format_javascript tips
May 16, 2016 pm 04:40 PMThe custom function parameters are passed in string format and the transmission method is
1: Pass this with
2: Quotes are defaulted
3: Escape characters (" in HTML represents "double quotation mark, ' represents single quotation mark, in JavaScript directly "" and Java universal escape character set)
<html> <head> <script language="LiveScript"> function print(arg){ alert("你好!"+arg); } </script> </head> <body> <form> <input type="button" name="Button1" value="first" onclick="print(this.str)" str="你好one"> <br><br> <input type="button" name="button2" value="second" onclick=print("你好two")> <br><br> <input type="button" name="button3" value="Third" onclick="print ("你好three")"> </form> </body> </html>

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Best practices for optimizing Golang function parameter passing performance

In-depth analysis of the declaration and call of JS custom functions

Detailed explanation of C++ function parameters: Performance optimization of parameter passing in parallel programming

Research on parameter passing methods in Go language

How to write custom functions in MySQL using Python

C++ function pointer parameter passing mechanism

golang function map passed as parameter

Creation of PHP user-defined functions
