< Ul > < Li > < A Href = "Javascript: void ();" > Title1 </ A > </ Li > < Li > < A Href = "Javascript: void ();" > Title2 </ A > </ Li > < Li > < A Href = "Javascript: void ();" > Title4 </ A > </ Li > < Li > < A Href = "Javascript: void ();" > Title3 </ A > </ Li > </ Ul >
When debugging with chrome, the following error occurs: uncaught syntaxerror: Unexpected token <,
After the Li Bing Click Event, write javascript: void () to href to control the <A> link operation ();
In this case, errors are always reported from time to time ..
That's strange ..
It is reported when jquery is tracked ..
Although this error does not affect the function, it does not affect the performance ..
The root cause is that javascript: void (); is written in <A>.
If you click Li, no error is reported. Click <A>.
Because the sequence of jquery implementation is from inner to outer.
SetCodeChange
< Ul > < Li > < A Href = "Javascript :;" > Title1 </ A > </ Li > < Li > < A Href = "Javascript :;" > Title2 </ A > </ Li > < Li > < A Href = "Javascript :;" > Title4</ A > </ Li > < Li > < A Href = "Javascript :;" > Title3 </ A > </ Li > </ Ul >
This error disappears.
There are many reasons for this error, but this is only one of them.