search

Home  >  Q&A  >  body text

javascript - Can the html page use js to directly call the interface?

The company is building a shopping mall website with a Java interface, but my friend only knows HTML and does not know back-end languages.
In terms of feasibility, all the pages of the mall use js cross-domain and remove the interface, without any background language. Can such a project be completed?

巴扎黑巴扎黑2806 days ago432

reply all(6)I'll reply

  • 给我你的怀抱

    给我你的怀抱2017-05-16 13:12:19

    The oldest front-end and back-end separation is like this. HTML files are placed on the static server. The browser accesses the static server to get the HTML and other resource files. After parsing, it sends an ajax request to the backend interface. The backend returns the data in Fill in the browser.

    The static server serves as the entrance, provides static file services, and forwards interface requests, so there is no need to cross domains.

    The disadvantage of this solution is the SEO problem. If SEO is not considered, this architecture is feasible.

    reply
    0
  • 高洛峰

    高洛峰2017-05-16 13:12:19

    Yes, it will be no problem if the backend interface allows cross-domain access

    Nowadays, many people use this method to separate the front and back ends. The front end only needs to do routing and data binding

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-05-16 13:12:19

    Yes, use CORS cross-domain.

    reply
    0
  • 天蓬老师

    天蓬老师2017-05-16 13:12:19

    Yes, no problem

    reply
    0
  • 给我你的怀抱

    给我你的怀抱2017-05-16 13:12:19

    No problem, you can. Use http protocol

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-05-16 13:12:19

    Use JSONP

    reply
    0
  • Cancelreply