Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1284976

    Hi

    If I add a new menu-item with a URI fragment it breaks JavaScipt on the whole webpage.

    This is an example of a link that breaks JavaScript:
    https://kvaskjer.hallingdal.no/#/search/what%255B%255D%3Dall%26where%255B%255D%3Dnesbyen%26when%3Dfromtoday%26q%3D/

    The is the error in DevTools:
    Uncaught Error: Syntax error, unrecognized expression: #searchwhat%255B%255D%3Dall%26where%255B%255D%3Dnesbyen%26when%3Dfromtoday%26q%3D
    at Function.se.error (jquery.min.js?ver=3.5.1:formatted:566)
    at se.tokenize (jquery.min.js?ver=3.5.1:formatted:989)
    at se.select (jquery.min.js?ver=3.5.1:formatted:1044)
    at Function.se (jquery.min.js?ver=3.5.1:formatted:299)
    at Function.s.find (jquery-migrate.min.js?ver=3.3.2:2)
    at S.fn.init.find (jquery.min.js?ver=3.5.1:formatted:1158)
    at s.fn.init.S.fn.init (jquery.min.js?ver=3.5.1:formatted:1179)
    at new s.fn.init (jquery-migrate.min.js?ver=3.3.2:2)
    at S (jquery.min.js?ver=3.5.1:formatted:55)
    at HTMLAnchorElement.<anonymous> (avia-footer-scripts-2535a365c290632ba50b5d1e2fdc7978—5f52781c95c5a.js:formatted:161)

    • This topic was modified 3 years, 8 months ago by bjornoss.
    #1285138

    Hey bjornoss,

    I could not reach the website and yes, that link should be removed or changed somehow.

    Best regards,
    Victoria

    #1285693

    Thanks for the reply

    The site should be available, could you try again?

    The link is a valid URL and should not break the website.
    Where can I report the bug to be fixed?

    #1285890

    Hi bjornoss,

    It is a jQuery limitation, we cannot really fix this bug.

    Best regards,
    Victoria

    #1286076

    Sure you can.

    You can check if the link is a on the same domain as the local site.
    If it is, then check the fragment.

    Or even easier, check if the fragment contains slash or other “invalid” jQuery ID characters before checking if the element exists.

    #1286664

    Any update on this?

    #1287116

    Hi bjornoss,

    We apologize for the delayed response.
    Please use a URL shortener like https://bitly.com/ to convert the link and make it usable without causing any issues.

    Best regards,
    Nikko

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.