使用AJAX加载非现场内容 [英] Loading offsite content with AJAX

查看:58
本文介绍了使用AJAX加载非现场内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个PHP页面,它会将一些非现场内容加载到DIV中。页面上还有其他静态元素。我遇到的问题是页面加载时间太长,因为PHP在显示页面之前加载了非现场内容。

I'm building a PHP page that will load some off site content into a DIV. There are other static elements on the page also. The problem I'm having is that the page takes too long to load because PHP loads the off site content before displaying the page.

我正在考虑加载非网站内容在DIV中通过AJAX。我假设无论加载AJAX DIV需要多长时间,页面的其余部分都会加载。

I am considering loading the off site content in the DIV via AJAX. I'm assuming the rest of the page would load regardless of how long it takes the AJAX DIV to load.

内容不需要更新或更改原始内容页面已加载。它只需要加载一次内容。

The content will not need to update or change while the original page is loaded. It just needs to load the content once.

我一直在搜索并找到了很多不同的技术来做到这一点。比如jQuery。

I have been searching for a while and have found a lot of different techniques for doing this. Such as jQuery.

你对如何做这个有什么建议吗?

Do you have any suggestions on how to do this?

教程的任何链接都会很棒。

Any links to tutorials would be great.

谢谢

推荐答案

我想这可以帮到你:

$('#result').load('ajax/test.html');

参考: jquery

这篇关于使用AJAX加载非现场内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆