jQuery-One-Page-Nav icon indicating copy to clipboard operation
jQuery-One-Page-Nav copied to clipboard

Uncaught TypeError: Cannot read property 'split' of undefined

Open serge852 opened this issue 11 years ago • 2 comments

Guess my situation must be sort of uncommon because this issue should have affected everyone but I can't find it reported here.

I kept getting Uncaught TypeError: Cannot read property 'split' of undefined in

getHash: function($link) { return $link.attr('href').split('#')[1]; },

until changed it to

getHash: function($link) { return ($link.attr('href'))? $link.attr('href').split('#')[1] : ''; },

My copy of plugin is 2.2 but this function didn't change in the latest code so maybe the error persists.

serge852 avatar Nov 01 '14 00:11 serge852

Do you have a link to your page? Are you correctly linking the nav to the sections?

davist11 avatar Nov 03 '14 23:11 davist11

Thanks It Worked

GauravNegi000 avatar Aug 09 '19 17:08 GauravNegi000