Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 99337

Use for questions about JavaScript code that is very specific to Drupal.

0 votes
Accepted

Somehow subscribe/react to addMessage

Basically, the problem was that I could not pass a variable from the preprocess function to JavaScript during AJAX requests (as mentioned several times in this issue). … A custom AJAX Callback Command was created that accepts the variable and invokes a JavaScript function, which in turn receives the variable. …
hga77's user avatar
  • 61
1 vote
1 answer
138 views

Somehow subscribe/react to addMessage

Here's the javascript: (function ($, Drupal, drupalSettings) { Drupal.behaviors.alwave_alerts = { attach: function (context, settings) { $('.my-class', context).once('unique-string' … Update: I discovered that the preprocess does not send the variable to javascript only on ajax requests. On first page load it is sent, but subsequent ajax requests do not send this variable to JS. …
hga77's user avatar
  • 61