Risks involved when using JS for refreshing contents
I'm learning about JS and its ability to call PHP scripts that enable you to reload parts of a website without having to load the entire page again.
I have looked at some other answers such as this one:
HTML - Change\Update page contents without refreshing\reloading the page
While I read these replies I was wo开发者_开发问答ndering: What are the risks involved when using these techniques? Is it not dangerous security-wise to call other scripts that then directly call the db?
Also: What is the best approach to go about it. Are there libraries that help you do the job?
It is same secure as normal pages - you can do same errors ( excluding this mistake - some frameworks with bad coding style can produce additional security risks ) - secure your server side script same way as for normal page.
Also : Yes there is a big amout of libraries that help you doing the job, and most frameworks have own part for dynamic loading ( AJAX ) - in example you showed it is jQuery helper.
精彩评论