简体   繁体   English

另一个完成加载后加载新页面

[英]Load a new page after another finishes loading

In my company we have a web-based tool that you enter an account, press a button, and the page takes a little bit to load, then loads account information. 在我公司中,我们有一个基于Web的工具,您可以输入一个帐户,按一个按钮,然后加载页面,然后加载帐户信息。 There are several different pages that do the same thing but load different information. 有几个不同的页面可以执行相同的操作,但是会加载不同的信息。 I have already been able to make the sites load with direct URL execution (with an intermediate page and some javascript) so I only have to enter their account number once. 我已经能够通过直接URL执行(带有中间页面和一些javascript)使网站加载,因此我只需要输入一次其帐号即可。 My problem is, I want them to pull up all at the same time to speed things up, but there is some kind of lock that does not let you run the lookup in two pages at once. 我的问题是,我希望他们同时拉起所有文件以加快速度,但是有某种锁不能让您一次在两个页面中运行查找。 I want to make my site load the first page, then wait til it loads and immediately begin loading the next page in another tab on my page. 我要使网站加载第一页,然后等待直到加载,然后立即开始在页面的另一个选项卡中加载下一页。 Is that even possible in HTML and Javascript? HTML和Javascript甚至可能吗? If so how, if not, what other language do I need to learn today? 如果是这样,如果不是,我今天需要学习什么其他语言?

check out the jquery's $(document).ready(); 查看jQuery的$(document).ready();

simply use 只需使用

$(document).ready(function () {

 //execute script that calls another page, you could use ajax 


});

other method is using iframes, which i personally don't recommend 其他方法是使用iframe,我个人不建议这样做

Do you mean something like Pageflakes ? 你的意思是像Pageflakes吗?

If so, you will need to utilise AJAX (and/or webservices). 如果是这样,您将需要利用AJAX(和/或Web服务)。 A good tutorial/source code on building something like this is at DropThings (which is from the same author as PageFlakes). DropThings (与PageFlakes来自同一作者)提供了一个很好的构建此类教程的源代码。 This is using ASP.NET C# and AJAX Control Toolkit. 这是使用ASP.NET C#和AJAX控制工具包。

如果将两个URL加载到单独的<iframe>元素中,则只需要为第一个帧创建一个load事件处理程序即可设置第二个帧的src属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM