


js uses map to get the id collection group and realize clicking on a row to select a row_javascript skills
1
Building opening
Big discount
2011-11-11
SMS notification
2
Building opening< br>Big discount
2011-11-11
SMS notification
;input type="checkbox" name="checkbox" id="btn"/>Select all
< ;tr class="dragableBox" id="box1" >
;input type="checkbox" name="box7" />
7
SMS | Upload time< ;/td> | Remarks | |
1 | Had a meeting and found that was wrong | 2011-01-30 | 五 |
2 | Meeting found something wrong | 2011-01-30 | 五 |
3 | 2011-01-30 | 五 | |
4 | Meeting Discovery< br>Error | 2011-01-30 | 五 |
5 | Had a meeting and found that was wrong | 2011-01-30 | 五 |
| 五 | ||
Having a meeting found there was an error | 2011-01-30 | 五 |
함수 HashMap()
{
/ **지도 크기 **/
var 크기 = 0;
/**물체 **/
var 항목 = new Object();
/**살다 **/
this.put = 함수(키, 값)
{
if(!this.containsKey(key))
{
크기 ;
}
항목[키] = 값;
}
/**선택하다 **/
this.get = 함수(키)
{
if( this.containsKey(key) )
{
반환 항목[키];
}
else
{
null을 반환합니다.
}
}
/**삭제 **/
this.remove = function (key )
{
if( 항목 삭제[key] )
{
크기 --;
}
}
/**키 포함 여부 **/
this.containsKey = function ( key )
{
return (항목의 키);
}
/**값 포함 여부 **/
this.containsValue = 함수(값)
{
for(항목의 var prop)
{
if(entry[prop] == value)
{
return true;
}
}
false를 반환합니다.
}
/**모든 가치 **/
this.values = function ()
{
var value = new Array(size);
for(항목의 var prop)
{
values.push(entry[prop]);
}
반환 값;
}
/**모든 키 **/
this.keys = function ()
{
varkeys = new Array(size);
for(항목의 var prop)
{
keys.push(prop);
}
반환 키;
}
/**지도 크기 **/
this.size = function ()
{
반환 크기;
}
}
// var map = new HashMap();
/*
map.put("A","1");
map.put("B","2");
map.put("A","5");
map.put("C","3");
map.put("A","4");
*/
/*
alert(map.containsKey("XX"));
alert(map.size());
alert(map.get("A"));
alert(map.get("XX"));
map.remove("A");
alert(map.size());
alert(map.get("A"));
*/
/**객체를 키로 사용할 수도 있습니다 **/
/*
var arrayKey = new Array("1","2","3","4");
var arrayValue = new Array("A","B","C","D");
map.put(arrayKey,arrayValue);
var value = map.get(arrayKey);
for(var i = 0 ; i < value.length ; i )
{
//alert(value[i]);
}
*/
/**객체가 Key로 사용되면 해당 객체의 toString() 메서드가 자동으로 호출됩니다. 실제로 String 객체가 Key*로 사용됩니다.*/
/**사용자 정의 객체인 경우 toString() 메서드를 재정의해야 합니다. 그렇지 않으면 다음과 같은 결과가 발생합니다.*/
// 함수 MyObject(이름)
// {
// this.name = 이름;
// }
/**
function MyObject(이름)
{
this.name = 이름;
this.toString = function ()
{
return this.name;
}
}
**/
// var object1 = new MyObject("小张");
// var object2 = new MyObject("소명");
//
// map.put(object1,"小张");
// map.put(object2,"소명");
// 경고(map.get(object1));
// 경고(map.get(object2));
// 경고(map.size());
//
/**실행 결과 닉네임 닉네임 크기 = 1 **/
/**toString() 메서드를 재정의하는 객체로 변경하면 효과가 완전히 달라집니다 **/

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

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



Frequently Asked Questions and Solutions for Front-end Thermal Paper Ticket Printing In Front-end Development, Ticket Printing is a common requirement. However, many developers are implementing...

There is no absolute salary for Python and JavaScript developers, depending on skills and industry needs. 1. Python may be paid more in data science and machine learning. 2. JavaScript has great demand in front-end and full-stack development, and its salary is also considerable. 3. Influencing factors include experience, geographical location, company size and specific skills.

JavaScript is the cornerstone of modern web development, and its main functions include event-driven programming, dynamic content generation and asynchronous programming. 1) Event-driven programming allows web pages to change dynamically according to user operations. 2) Dynamic content generation allows page content to be adjusted according to conditions. 3) Asynchronous programming ensures that the user interface is not blocked. JavaScript is widely used in web interaction, single-page application and server-side development, greatly improving the flexibility of user experience and cross-platform development.

How to merge array elements with the same ID into one object in JavaScript? When processing data, we often encounter the need to have the same ID...

Discussion on the realization of parallax scrolling and element animation effects in this article will explore how to achieve similar to Shiseido official website (https://www.shiseido.co.jp/sb/wonderland/)...

In-depth discussion of the root causes of the difference in console.log output. This article will analyze the differences in the output results of console.log function in a piece of code and explain the reasons behind it. �...

Explore the implementation of panel drag and drop adjustment function similar to VSCode in the front-end. In front-end development, how to implement VSCode similar to VSCode...

Learning JavaScript is not difficult, but it is challenging. 1) Understand basic concepts such as variables, data types, functions, etc. 2) Master asynchronous programming and implement it through event loops. 3) Use DOM operations and Promise to handle asynchronous requests. 4) Avoid common mistakes and use debugging techniques. 5) Optimize performance and follow best practices.
