Global JavaScript and CSS Files

In your extension, you can adjust Plesk functionality and appearance by means of JavaScript and Cascading Style Sheets (CSS). These technologies enable you to do a variety of customizations to the Plesk interface, for example, adding new GUI elements and hiding existing ones. To make Plesk load your JavaScript or CSS code on every page of Plesk, put the code in the files global.css and global.js inside the /htdocs directory.

To load the code only on certain pages, use a construction like the following:

if ("/smb/file-manager/list" != window.location.pathname) {
    	return;
    }

The Plesk's JavaScript framework is Prototype.

If you need to load additional libraries, you can do this directly in HTML, for example:

$$("head").first().insert(
    	new Element("script", {type:"text/javascript", src:"//example.com/example.js"})
    );
 

Leave your comments on this page

Leave your feedback or question on this documentation topic below. For technical assistance, contact your hosting service provider or submit a request to Plesk support. Suggest new features for Plesk here. Discuss general questions on the Plesk forum. All offtopic comments will be removed.