javascript - Catching in page links with jQuery -


Hello, I want to turn on a function when the user clicks on the page link, for example abc.com/hello. Html # variable1 I want #Virible1 to capture and execute the function.

If you want to get the string after the hash:

  $ ("A [href * = '#']"). Click (function () {var hash = this.href.replace (/.*#(.*)$/, '$ 1'); // return something incorrect}};  

Comments

Popular posts from this blog

.net - C# List<T>.Find(x=>x.Rectangle.Contains(Point)) FAIL -

iphone - Smoothing a rounded stroke in Core Graphics -

c++ - QtQuick: QQmlApplicationEngine failed to load component qrc:/main.qml:23 Invalid attached object assignment -