JavaScript functions: Difference between revisions
From MoodleDocs
Helen Foster (talk | contribs) |
David Mudrak (talk | contribs) m (Text replacement - "<code php>" to "<syntaxhighlight lang="php">") |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{obsolete}} | |||
The functions mentioned here are deprecated. The correct way to use JavaScript in Moodle is documented on [[JavaScript_guidelines]]. | |||
If you want to see which JavaScript functions are available on a Moodle page you can use the Firefox [[Web developer extension]]: ''Information > View JavaScript''. | |||
Some things that can be there: | |||
<syntaxhighlight lang="php"> | |||
/lib/javascript-static.js | |||
// Miscellaneous core Javascript functions for Moodle | |||
function popupchecker(msg) { | |||
var testwindow = window.open('itestwin.html', '', 'width=1,height=1,left=0,top=0,scrollbars=no'); | |||
if (testwindow == null) | |||
{alert(msg);} | |||
else { | |||
testwindow.close(); | |||
} | |||
} | |||
... | |||
</syntaxhighlight> | |||
and | |||
lib/overlib.js | |||
==See also== | |||
* [[JavaScript_guidelines|Coding guidelines for JavaScript in Moodle]] | |||
* [http://developer.yahoo.com/yui/ YUI documentation] | |||
* [[Unobtrusive_Javascript]] | |||
* [[Javascript FAQ]] |
Latest revision as of 13:38, 14 July 2021
Warning: This page is no longer in use. The information contained on the page should NOT be seen as relevant or reliable. |
The functions mentioned here are deprecated. The correct way to use JavaScript in Moodle is documented on JavaScript_guidelines.
If you want to see which JavaScript functions are available on a Moodle page you can use the Firefox Web developer extension: Information > View JavaScript.
Some things that can be there:
/lib/javascript-static.js
// Miscellaneous core Javascript functions for Moodle
function popupchecker(msg) {
var testwindow = window.open('itestwin.html', '', 'width=1,height=1,left=0,top=0,scrollbars=no');
if (testwindow == null)
{alert(msg);}
else {
testwindow.close();
}
}
...
and
lib/overlib.js