Difference between react.js and Ajax

后端 未结 4 1758
[愿得一人]
[愿得一人] 2021-01-29 23:50

When I googled about React.js what I got is: React.js is a Framework that is used to create user interfaces. If a particular part of the website is frequently updated that means

4条回答
  •  孤独总比滥情好
    2021-01-30 00:07

    Ajax

    We are using ajax to send http requests. And we can't re-render a particular area of the page(DOM) by using ajax alone. We need jquery to re-render the page after an ajax call came up with the respond. Actually comparing jquery+HTML and React.js far better than comparing ajax and React.js.

    React.js

    The role of the react.js is dividing page(DOM) into small peaces(Components). ex:- Profile image area, Main Navigation, Sidebar, Textfield, Button. etc. from Big peaces to small peaces. Most importantly we can bind functionalities into these components. Ex:- Let's assume users need a popup to upload a profile image by clicking on above "Profile image area". We can write a function to open a popup. And also we can write another function to upload profile image to the database. In this way we can use ajax inside the React.js

    Please follow this tutorial.

提交回复
热议问题