Skip to content

Support for responseKind js/script #48

Closed
@PedroAugustoRamalhoDuarte

Description

In my project we use ajax to handle request in stimulus and we are trying to update to request.js:

Example:

$.ajax({
  beforeSend: function (xhr) {
    xhr.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content'));
  },
  url: url,
  remote: true,
  dataType: 'script',
  type: 'get',
});

For this we need this dataType script to execute js files, but in the request.js docs there are only 3 options for responseKind (html, turbo-stream, json). A new script option would be interesting

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