Table of Contents

The files needed in a module

To support Ajax you must some files in your module structure.

mymodule/pnjavascript/mymodule.js

mymodule/pnstyle/style.css (might be present already)

mymodule/pnajax.php

mymodule.js

Contains the module specific javascript. It is recommended to move all Javascript into this file except the absolute minimum which has to go into the template:

var somedefine = ‘<!--[ pnml name=”_MYMOD_SOMEDEFINE” ]-->

has to be stored in the template to enable multilanguage error / hints. You cannot define this in your external .js file.

Event.observe(window, ‘load’, function(){mymoduleinit();}, false);

adds an onload() eventhandler which is executed after the page has been completely loaded to init some defaults, add event observers, unhide buttons etc.

pnstyle/style.css

holds the CSS for your div’s etc.

Important and often used classes are

.invisible { display:none; } .sortable { cursor: move; }

pnajax.php

This is the entry point for Ajax functions in your module. All Httprequests have to be directed to ajax.php, see ajax.php for more information.

 
ajax/files.txt · Last modified: 2006/04/14 05:51 by landseer
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki