The difference between href=# and href=javascriptvoid (0)

time:17-04-11 forum:
  http://www.cnblogs.com/weeky/archive/20... 40655.html

.Quot; contains a location information / > the default anchor point is the upper end of the web page. T.#058; void (0) only represents a dead link

that is why some pages are long browsing links clearly but jump to the header

and javascript.#058; void (0) is not so

so it is best to use void (0)
or > when calling the script.
.lt; div onclick.gt;

several ways to open a new window link;

1.window.open ('url')
obj.click ();
}
.Lt; /script.gt; [/code]

-------------------------------------------------------------------------------

if it is a />
there will be a jump to the top of the case:
1:.lt; a href=.quot; ####.quot; Pt.#058; void (0).Quot;.Gt;.Lt; /a.gt;
3:.lt; a href=.quot; javascript.#058; void. Void is an operator in >


JavaScript, which specifies that an expression is calculated but not returned. The usage format of the
void operator is as follows:
1. javascript.#058; void (expression)
2. javascript.#058; void expression

.lt; a href=.quot; javascript.#058; void (0).Quot;.Gt; click here nothing will happen to.Lt; /a.gt;
that is, to perform some processing, but not to refresh the page as a whole, you can use (0), but it will be careful when the page is needed.

we can actually use.Lt; a href=.quot; javascript.#058; void (document.form.submit ()).Quot;.Gt; this sentence will do a submit operation. In that case with void (0) more, no refresh, of course, Ajax, look at the Ajax web page, the general will see a lot of void (0),), so in the use of void (0), it is best to think about, this page needs a whole new brush.

prev:Ji'nan's Licheng District opened the stu... next:The change of the black tiger spring in ...
post comment
Notice



approved   What's the use and use of the social...   A glimpse of the Intangible Cultural...   The couple made tea by hand in deep ...   What day can "star children" be inte...   Ji'nan Qianfo Hill Xingguo monastery...
rand   Div floating center single div box a...   JavaScript open source cross platfor...   The 9 best JavaScript development to...   Breaking the restriction of the phot...   Open a new window with the window.op...
ads

other

Because all the contents of this site are reproduced from other media, the intention is to provide free services to the public, but it does not mean that this site agrees with its views, and can not be responsible for the authenticity of its verification, such as the copyright unit or individual of the manuscript does not want to publish on this site, please Contact me, I will immediately remove it, thank you. Contact: atseashawk@163.com