Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Getting Started With Moodle Java Script Coding: Difference between revisions

From MoodleDocs
(Created page with "==Moodle Settings for Javascript Development== The following settings will ensure that the js loaded by your browser is relatively readable. Make sure that : * your Developme...")
 
No edit summary
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
==Moodle Settings for Javascript Development==
{{obsolete}} This page text has been removed because it is obsolete. A replacement is available in [https://docs.moodle.org/dev/Javascript_Modules Javascript Modules].
 
The following settings will ensure that the js loaded by your browser is relatively readable.
 
Make sure that :
 
* your  Development / Debugging / Debug messages is set to "Developer : Extra Debug Moodle Messages ...." - Moodle will then use the debug non-minified and thus more readable YUI 2 and YUI 3 library files.
* You will probably want to change some of the settings at "Home / Site administration / Appearance / AJAX and Javascript" :
** YUI combo loading - you probably want to turn this off so that files are not combined.
** Javascript caching and compressing - turn this off so that your custom JS code is not minified.
** Check the other settings on this page to see that they are as you would expect them to be.
 
==Use Firebug or the Built in Chrome Developer Tools==
 
Once the js code that you load into the browser is a little more readable you can now use the excellent debugging tool built into Chrome, the Firebug extension available for FF or Firebug lite for IE.
 
These tools allow you to set breakpoints in js code examine variable and to use commands in your js such as console.log() which can give you a treeview of the contents of the contents of any object that you send it.
 
==Support for JS in Your PHP Editor==
 
Am not sure if there is the possibility to get context sensitive help or to be able to jump to declaration of classes, methods etc in PHP editors such as Eclipse, Zend IDE etc.
 
==Documentation on the Use of JS in Moodle==
 
* [[JavaScript guidelines]]
 
[[Category:Javascript]]

Latest revision as of 05:32, 2 December 2016

Warning: This page is no longer in use. The information contained on the page should NOT be seen as relevant or reliable.
This page text has been removed because it is obsolete. A replacement is available in Javascript Modules.