Hi,
I have a plugin that's sending users to the wrong url when on certain pages, so I want to override that url.
Tried the following which checks if myloc ends in faq.html, if it doesn't (false) then I need to pull the url for "ul.navlist a" & force page to go to it. I've tried putting return:false in there, but can't seem to get it running.
- $('ul.navlist a').click(function() {
- var baseloc = $(location).attr('href'); // get current pg's url
- var stringCheck = "faq.html";
- var myloc = (baseloc.lastIndexOf(stringCheck) === baseloc.length - stringCheck.length) > 0;
- // test if myloc is true/false
- if (myloc == "false") {
- var newloc = this.attr('href');
- window.location = newloc;
- }
- });
What do I need to change?
Thanks, Bill