Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the rules for ajax development?

Shulou Source: shulou.com Published: 2022-06-03 05:38:41 09月20日 Update

Editor to share with you what ajax development rules are, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

1. Security checks should be done at both the front and back ends.

You can't just rely on the front end to do security verification, and the back end must also have a filtering mechanism to check the data coming from the front. Since Ajax also receives data sent from the back end, it is necessary to take a distrustful attitude towards these data and must be checked.

two。 Try to transmit data by HTTP POST method.

Using the GET method is easy for interested people to get information. Although POST is not foolproof, it is at least safer than GET.

3. Do not directly use the eval function to invoke the JSON object

JSON (JavaScript Object Notation) is the data format of JavaScript object. When transferring from the back end to the Ajax program, you must use the eval function to convert it from the string to the object. At this time, you must first check whether there are illegal characters in the data to prevent the illegal program from taking the opportunity to start.

4. Limit the HTML syntax available to users

Many Ajax sites allow users to use HTML syntax in their messages, and certain grammars should be strictly restricted, such as < plaintext > or

Tags: Data users content programs syntax development security objects frameworks articles websites transmissions codes people parts techniques benefits methods ease of use status Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Huawei Microsoft Shulou Information macOS