To fix the problem, you must first find it. The following are the main errors that may prevent the script from running:
- Conflict with the browser. Typically, the code is written for the most common browsers and sometimes the developer does not take into account its correct display in unpopular web-programs.
- The script does not match the site builder. The problem is similar to the previous one. The script can be written for the most common CMS, not taking into account the nuances of some free engines, such as WordPress, Ucoz, etc., which use their own programming languages that conflict with the conventional code.
- Incorrect file upload to server. By the FTP protocol, there are three options for uploading a script to the hosting: auto-detection, text and binary. Many often do not pay attention to this step, because of what the script does not function correctly.
- The script handler is not connected. It's not enough just to upload the file to the hosting, you must also specify the handler function, specifying the script, what action it should respond to. Typically, this function is specified within the <body> ... </ body> tags, telling which event the script should react to. For example: <input type = "button" onclick = "helloworld ()" value = "Hello world!" />.
- No additional libraries forprocessing the script. Before you enable the JS script, you need to make sure that the most common library is used to develop the jQuery script.
- Script processing is not allowed by the browser. The problem is solved quite simply - by connecting this function in the browser settings.
Connecting the jQuery library
Let's take a look at the Java language example of a script, how to enable the jQuery library, so that the necessary processing of scripts can work:
- Download the latest version of jQuery from the official site;
Enable browser settings
A fairly common cause of the incorrectThe work of the script is to disable its processing in the browser. Below is the instruction to enable this setting on an example of the popular Google Chrome browser:
- Open the Google Chrome Settings and Controls menu.
- Select Settings.
- Turn on the demonstration of advanced settings.
- In Personal Data, click Content Settings.
You can also benefit from the How to Run the Script article.