Instruction
1
Javascripts are scripts that runs on the server, but directly in the browser, that's why they are called "client". If the script came to you in a separate file with the extension "js", then connect it to the page it is necessary to add in the header part of the HTML-code of the corresponding tag with the link to the file. The header is the part that starts with <HEAD> tag and ends with </HEAD> tag. So you can't go wrong if you find in the page code the closing tag </HEAD> and place before him a link to an external JavaScript file:<script type="text/javascript" src="script.js"></script>Here the src attribute specifies the name of file "script.js" - you should change the name of your js file. In order for the browser to find and read this file, it should be placed in the same folder of the server where is the page itself. If you uploaded it to another location - specify the appropriate address together with the name of the file in the src attribute.If you have JavaScript not in a separate file, but just in the form of text starting with the <script > tag, just paste it into the same place the source code of the page (before </HEAD> tag). Some scripts should be placed in the header part, but you can only find out reading the manual from the author, be sure to do that before the manipulation by the insertion of the code. Besides, usually, in addition to the core code that contains the necessary to work the scriptand functions to different elements of the page need to attribute links to these functions. What elements (buttons, table cells, images, blocks, etc.) what is the function of the whole set and what events (mouse over, finish loading, text input, etc.) - all of which should be specified in the instructions from the author of the script. Therefore, if you do not have a clear enough description, then, it may be better to look for a replacement than spending more time on the experiments without any guarantee of obtaining a workable scriptin your page.
2
Scripts written in PHP are executed on the server side and are called, respectively, "server". Here, too, if the script came to you in a separate file, the code page you want to add a link to it. In PHP this could look like this:<?php include "script.php"; ?>Specifies the name script.php - you need to replace it with the name of your existing file. Paste this code at the top of the page before all existing tags. It is important to ensure that the php code has no blank lines or spaces. If the page to which the inserted code has the extension. htm or. html then the php code will not be executed by the server, the extension must be "php".If the PHP code the scriptand not in a separate file and starts with <?php or just <?, then paste it should be right in the page, without reference to an external file. These blocks of PHP code can be scattered to different parts of the HTML code of the page. In the case of PHP-striptm the presence of the user is more important than the client scripts - wrong usage of server-side scripts can ruin your website's files stored on the server!
3
The very same procedure to insert code in the page is the same for both server and client scripts. If you have a file, we first need to upload it to the server. This can be done via FTP Protocol, using a special program (FTP client). Find this app on the web is not difficult, for example, Cute FTP, FlashFXP, FileZilla, WS FTP, Smart FTP etc. Download using FTP client takes place via the FTP Protocol (File Transfer Protocol "file transfer Protocol"). But you can download a file directly through the browser using the file Manager available in the content management system and hosting control panel.After downloading the file (or files) to the server, you will need to edit the HTML code of the page. It can also be done via the browser if you are using a content management system. The system should be the page editor, in which you have to open the page, switch the editor mode to edit HTML code, insert the prepared code and save the changes. If there is no control system, then download the page to your own computer, edit it using a simple text editor and upload back to the server.