search

Home  >  Q&A  >  body text

jquery-ajax - How to implement partial refresh in thinkphp3.2.3

Novice SolutionFor example, if I want a sidebar navigation on a page, click on one of the a tags, and the p on the right will load the corresponding html file. So how can thinkphp implement such a function? Use jq's load? post? Do I need to write the head and body tags in the loaded HTML? Or can I just write the content that needs to be loaded in the p on the right? And how to deal with their css js?

天蓬老师天蓬老师2813 days ago917

reply all(3)I'll reply

  • 为情所困

    为情所困2017-05-16 13:17:25

    This has nothing to do with TP anymore

    1. If you follow your method, you can asynchronously request the required html code, and then put it in p on the right. Don’t write the loaded html head and body, just write the html in p. Similarly, you can try iframe, click on the sidebar navigation, and directly let the iframe load a link

    2. You can try to include sidebar navigation in each page, for example, a.html b.html. Click the sidebar navigation of a.html to jump directly to b. Anyway, b also has sidebar navigation (sidebar navigation is in view The level can be written as public, and the tp template should also support it)

    reply
    0
  • 大家讲道理

    大家讲道理2017-05-16 13:17:25

    Using jq’s load or post, you can directly write the content that needs to be loaded in the p on the right. css js can be used on this page or css js file writer

    reply
    0
  • 为情所困

    为情所困2017-05-16 13:17:25

    ajax jquery’s $.get or $.post can achieve it

    reply
    0
  • Cancelreply