在onload上加载ajax页面? [英] load ajax page on onload?

查看:169
本文介绍了在onload上加载ajax页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的index.html页面中,我想在加载应用程序时加载一个单独的ajax页面, 最好的方法是什么? 这是我的索引代码:

In my index.html page I want to load a seperate ajax page when the app is loading, what is the best way of doing that? This is my index code:

子页面就是:

谢谢.

推荐答案

使用JavaScript,您可以做到这一点.您必须在页面加载时执行此操作.这是jQuery中的示例.

using JavaScript you can do that. You have to do that on page load. Here is an example in jQuery.

$(function(){
    $('#content').load('/content.html');
});

这篇关于在onload上加载ajax页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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