jquery-ajax - How to implement partial refresh in thinkphp3.2.3
天蓬老师
天蓬老师 2017-05-16 13:15:25
0
3
887

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?

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(3)
为情所困

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)

大家讲道理

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

为情所困

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template