Wicket
  1. Wicket
  2. WICKET-5270

Do not set the location.hash when clicking on a link

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 6.9.0
    • Fix Version/s: 6.10.0, 7.0.0
    • Component/s: wicket
    • Labels:
      None

      Description

      Clicking an AjaxLink or SubmitLink sets the location.hash to an empty value (..../someUrl?some=param#).
      This interferes with JavaScript libraries which need to use 'hashchange' event.

      Additionally in two of our apps we experience a strange page reloads after clicking on AjaxLink.
      The issue is not easy to reproduce but it seems to be caused by the used href="#" somehow.
      Applying a custom behavior that overrides href="#" with href="javascript:;" fixes the problem.

      The problem occurred on Google Chrome and IE9 so far.

        Activity

        Hide
        Martin Grigorov added a comment - - edited

        Changed
        tag.put("href", "#") to tag.put("href", "javascript:;").
        Tested it on IE 8/9, Chrome, Opera 12, Safari 5.x, on Ubuntu and Windows XP/7 with both HTTP and HTTPS.

        Show
        Martin Grigorov added a comment - - edited Changed tag.put("href", "#") to tag.put("href", "javascript:;"). Tested it on IE 8/9, Chrome, Opera 12, Safari 5.x, on Ubuntu and Windows XP/7 with both HTTP and HTTPS.

          People

          • Assignee:
            Martin Grigorov
            Reporter:
            Martin Grigorov
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development