Skip to content

Ajax request is displayed in url #1210

@digiwirtual

Description

@digiwirtual

All requests marked with the .ajax class are processed correctly, with one small detail — the href link is also displayed in the URL.
Naja implements a HistoryHandler, which should be disabled either globally using
naja.defaultOptions.history = false;
or per request using
naja.makeRequest('POST', '/ping', null, { history: false });

Another option is adding ->setDataAttribute('naja-history', 'off') to all buttons using ajax.

Reason: When the user refreshes the page after an AJAX request that displays the href link in the URL, the request is processed a second time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions