How to upload JS file (JavaScript)
ClickEshop administrator allows you to insert your own JavaScript code and in this way add new features to your website / webshop e.g. add new popup window, questionnaire, contact form etc. JS (JavaScript) usually stored in external .js files.
To upload JS file into ClickEshop administrator please follow the steps below:
- in [Content Management] on the left tool bar click the button [Global HTML code]
- system opens a new window
- click the button "Upload files on server"
- system will open a central file storage that allows you to upload files and sort them into folders
- upload JS file (.js) to central file storage
- mark the JS file and press the button "Insert"
- system will automatically create a link to this file and attach to the project, while it is inserted between the tags <head></head>
Here's an example for a script which will be performed in the online store only in the product detail page :
document.addEventListener("ce_cms-reload_window",function() {
if( $('#page_product_detail_out').length > 0 ) {
//Volanie nejakeho scriptu po nacitani stranky detail produktu
alert(1);
}
});
We recommend to insert all scripts into external .js files and only link to the project. It is not recommended to insert the JavaScript directly into the page source code.