Skip to content
Snippets Groups Projects
Commit 4fdc90e1 authored by Neil Drumm's avatar Neil Drumm :wave:
Browse files

#76637 by timcn. Adding some documentation to drupal.js.

parent 02b3898e
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -21,8 +21,20 @@ if (isJsEnabled()) {
document.documentElement.className = 'js';
}
/**
* The global Drupal variable.
*/
Drupal = { };
/**
* Merge an object into the Drupal namespace.
*
* @param obj
* The object that should be merged into the Drupal namespace. Arbitrary objects
* containing functions, variables or other objects can be used. An example object
* would be { settings: { tree: { '/js/menu/tree': { mid: 206 } } } }. This item
* can now be accessed at Drupal.settings.tree['/js/menu/tree'].mid.
*/
Drupal.extend = function(obj) {
for (var i in obj) {
if (this[i]) {
......@@ -32,7 +44,7 @@ Drupal.extend = function(obj) {
this[i] = obj[i];
}
}
}
};
/**
* Make IE's XMLHTTP object accessible through XMLHttpRequest()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment