0

I know this question have been asked alot, but i can't find a fix...

<script>
    $(function () {
        var url = window.location.href;
        var page = url.substr(url.lastIndexOf('/') + 1);
        target = $('.ActiveMenu a[href*="' + page + '"]');
        $(target).addClass('active');
        console.log(target);
    });
</script>

Main.js https://codepen.io/anon/pen/VbNzLP

enter image description here

Homme
  • 23
  • 8
  • The error you got is not related at all to the code you added, it's related to `$.get/$.post/$.ajax` – Dekel May 26 '17 at 12:04
  • the error you are getting is related to get/post/ajax request. not the code you shown – Alive to die - Anant May 26 '17 at 12:05
  • So what can i do? – Homme May 26 '17 at 12:06
  • Find the relevant code and fix it? It's kind of like asking "my isn't my whatsapp working?" when you took of the battery from your phone... – Dekel May 26 '17 at 12:07
  • added main.js, is this relevant? – Homme May 26 '17 at 12:11
  • Are you using visual studio? It seems the error is coming from the BrowserLink tool (the thing that refreshes your styles in browser when you make a change in code without actually refreshing the page). I don't think it's connected to your code. – Samuil Petrov May 26 '17 at 12:14
  • Yes i'm using visual studio. – Homme May 26 '17 at 12:15
  • Well it's not your fault, it's just the way the feature is written (using async: false). You can disable it if you are not using it and don't want to see this message, you can refer to this answer: https://stackoverflow.com/a/32615326/4108884 – Samuil Petrov May 26 '17 at 12:19
  • Well i disabled BrowserLink, but it didn't add the class? – Homme May 26 '17 at 12:27

1 Answers1

0

Disabled BrowserLink and fixed my markup, did the trick. Thanks

Homme
  • 23
  • 8