使用JS刷新内容存在的风险
我正在学习 JS 及其调用 PHP 脚本的能力,这些脚本使您能够重新加载网站的部分内容,而无需再次加载整个页面。
我查看了其他一些答案,例如这个:
当我阅读这些回复时,我想知道:使用这些技术时涉及哪些风险?调用其他直接调用数据库的脚本从安全角度来说不是很危险吗?
另外:最好的方法是什么?有图书馆可以帮助您完成这项工作吗?
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 wondering: 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它与普通页面一样安全 - 您可以执行相同的错误(排除此错误 - 某些编码风格不良的框架可能会产生额外的安全风险) - 以与普通页面相同的方式保护您的服务器端脚本。
另外:是的,有大量的库可以帮助您完成这项工作,并且大多数框架都有自己的动态加载部分(AJAX) - 在示例中您展示了它是 jQuery 助手。
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.