开发者

Jquery href with hash

i am using tis code for tab navigation.

function hashIt(toHash) {
    toHash == "" 
     ? window.location.hash = window.location.hash.replace( /#.*/, "") 
     : window.location.hash = toHash;
    return false;
}

and also i am using jquery popup on page onload. a hyperlink in the popup is not working, if i remove the h开发者_开发百科ashIt function its fine. but i want both. Please help me out.

Ramesh.


Your function should just be

function hashIt(toHash) {
    window.location.hash = toHash;
}

without all the extra logic. Then to clear the hash, just call hashIt("");


try to remove return false;, then check if it still works... (suspecting something)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜