Created
April 12, 2023 07:06
-
-
Save prashantdsala/654e42741a0233b50470face5818013e to your computer and use it in GitHub Desktop.
Drupal - AJAX request using Drupal ajax and get response
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajax({ | |
url: '/myurl/ajax', | |
type: 'POST', | |
data : { | |
title: title, | |
type : type, | |
target: target, | |
view : view, | |
display:display | |
}, | |
success:function(response) { | |
var ajaxObject = Drupal.ajax({ | |
url: "", | |
base: false, | |
element: false, | |
progress: true | |
}); | |
// Simulate an AJAX response having arrived, and let the Ajax | |
// system handle it. | |
ajaxObject.success(response); | |
$(target).show(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment