Javascript: What does void (0) mean and the difference between href = # And href = javascriptvoid (0,
In Javascript, void is an operator that specifies to calculate an expression but does not return a value.
The format of the void operator is as follows:
1. javascript: void (expression)
2. javascript:
You can often see this in JavaScript scripts.
Code:
But what does void (0) mean?
In JavaScript, void is an operator that specifies to calculate an expression but does not return a value.
The format of the void operator is as follows:1. javascript: void (expression)2. javascript:
Href = "javascript: void (0);" and,
There are two ways to set the
Href = "#". When you click it, it will jump to the top of the page, which is equivalent to clicking an anchor. A # identifier will appear after the URL.
While href = "javascript: void (0);" is to execute a javascript expression. Void (0) does not execute or return anything, so no jump occurs.
Array name and pointer difference (array name is not a pointer, is the first address of the array), array pointer
Some time ago, after a C language lesson, the teacher said, "the array name is a constant pointer to the first address of the array ".
I have checked some of them over hundreds of times, including many tuto
Package com.java_1; Public class Hello { publicstaticvoid main (string[] args) { System.out.println ("Hello world~~~");} } This is the Java program's entry address, the Java Virtual machine runs the program when the first thing to look for is the main method. The function of the main () function is the same as the C language. Only the main () Method Java program can be the Java Virtual machine to line, can be understood as the specified format for the parameters and modifiers
This should be an MFC program, On_message is to add a message response function, this sentence is to add a hotkey wm_hotkey response function. When you register the hotkey, when the user presses the hot key, the Onhotkey function is executed to process the message. The error should be onhotkey the declaration of this function is wrong, the return value should be lresult. VS2008 the message is more stringent inspection, previously in VC6 completely normal operation of the message map under the VS
Void is an important keyword in JavaScript that can be used as a unary operator before its single operand, and may be of any type.
This operator specifies an expression that does not require a return value to be evaluated. Its syntax may be one of the following:
Example 1:
The most common use of this operation is the client-side Javascript:url, which evaluates the expression that calculates its boundary effect, without displaying the b
I want to use the following common ajax code: lt; ahref quot; javascript: doTest2 (); void (0); quot; gt; here lt; a gt; but what does void (0) mean? I want to use the following common ajax code:
Here
But what does void (0) mean?
In Javascript, void is an operator that specifies to calculate an expression but do
After clicking the link, if you do not want to roll the page to the top, you can use href = "javascript: void (0)" instead of href = "#". return false also plays a similar role.
DetailsHref = "#" And href = "javascript: void (0 )""#" The default anchor that contains a location information is # top, that is, the top of the web page, and javascript: void (0) it onl
From: http://s319.dlut.edu.cn/educ/83.htm§ 8. 4 pointer to a string and pointer to a string
8.4.1 String Representation
In CProgram.
1. Use a character array.
[Example: 8.11]
Void main (void)
{Static char string [] = "I love China! ";
Printf ("% s \ n", string );
}
Runtime output: I love Chin
The void operator explains that JavaScript scripts often see the following code:
But what does void (0) mean?
In JavaScript, void is an operator that specifies to calculate an expression but does not return a value.
The format of the void operator is as follows:
1. javascript:
Reasons and benefits of using quot; return obj ==void 0 quot; in javascript
When I learned about underscore. js, I found that the following code often appears in the source code:
if (context === void 0) return func;if (array == null) return void 0;
I have never seen this method before. I searched some materials on the Internet and found that some people in sta
Front.
There are a total of 46 operators in JavaScript, and there are many operators in addition to the arithmetic, relational, bitwise, and logical operators described earlier. This article describes the conditional operator, the comma operator, the assignment operator, (), and the void operator
Conditional operator
The conditional operator is the only ternary operator (three operands) in JavaScript, sometimes directly called the ' ternary operat
Goto:The quality of the program is inversely proportional to the number of Goto occurrences, disablingGoto side Effects: The process of executing the program in a structured sequence, it is possible to skip some steps that should be performed by the program.voidmodifier function return values and parametersThe size of void's memory space is not defined in the C language, and it is not possible to crop void-corresponding variables in memory, but differ
"#" Contains a location informationThe default anchor is # top, that is, the top of the web page.Javascript: void (0) only indicates a dead link.
This is why sometimes a long page browsing link is clearly # But the page jumps to the top, while javascript: void (0) is not.Therefore, it is best to use void (0) when calling the script)Or
How to open a new window Li
There are many ways to do nothing after clicking a link, but it is not conducive to the user experience. javascript: void (0) can effectively solve this problem during page creation, if you want to do nothing after clicking a link or respond to the click to complete other tasks, you can set its property href = "#". However, this may cause a problem, when a page has a scroll bar, it will return to the top of the page after clicking it. the user experie
meaning of void (0) in JavaScriptOverviewThe void operator executes the statement passed to it, and then returns undefined. Grammarvoid expressionThe void operator is usually used only to get The original value of the undefined, usually with void (0) (equivalent to void 0
The void type in C is actually a universal type, which means that our void can represent any type, that is, his range is wider than a specific type, for example:int *p = NULL;void *ptr = P; This is possible because the void * type contains an int * type, but you must be forced to convert to a certain type before using
When reading the JDK source code, we found a class void, a placeholder class that is not instantiated and holds a reference to the class object that identifies the Java keyword void.
The class definition for void is as follows:
Package Java.lang;Public final class Void {Private V
I recently read several posts about the Note: The following code is not fully tested, but the possible situation of each method is basically described.
When you do a page, if you want to do nothing after clicking a link, or respond to the click to complete other tasks, you can set its property href = "#", however, in this case, when a page has a scroll bar, clicking it will return to the top of the page, and the user experience is poor.
There are currently several solutions:1) do not do anything
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.