Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修正在Chrome下单击左侧API时控制台报错的问题 #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xqin
Copy link

@xqin xqin commented Nov 11, 2013

错误信息:
Uncaught RangeError: Maximum call stack size exceeded.
原因是:
使用location.replace会导致页面重新加载,当有hash值时,powerSwitch会自动触发click事件(576行),而click事件会触发onSwitch事件,所以就死循环了.

if (anchorSplit && element.href && anchorSplit == element.href.split("#")[1]) {
    $(element).trigger("click");    
}

错误信息:
`Uncaught RangeError: Maximum call stack size exceeded. `
原因是:
使用location.replace会导致页面重新加载,当有hash值时,`powerSwitch`会自动触发click事件(576行),而`click`事件会触发`onSwitch`事件,所以就死循环了.
```
if (anchorSplit && element.href && anchorSplit == element.href.split("#")[1]) {
	$(element).trigger("click");	
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant