Override url

Override url

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.

  1. $('ul.navlist a').click(function() {
  2.     var baseloc = $(location).attr('href');  // get current pg's url
  3.     var stringCheck = "faq.html";
  4.     var myloc = (baseloc.lastIndexOf(stringCheck) === baseloc.length - stringCheck.length) > 0; 
  5.     // test if myloc is true/false
  6.     if (myloc == "false") {
  7.       var newloc = this.attr('href');
  8.       window.location = newloc;
  9.     }
  10. });

What do I need to change?

Thanks,  Bill