jquery加载页面问题

发布于 2024-07-10 10:33:57 字数 181 浏览 8 评论 0原文

我对使用 jQuery 比较陌生,并且希望使用 load 方法将内容拉入我的页面,因为我托管的网站不支持任何服务器端脚本。

我希望能够在正在拉入的页面(通过加载方法)运行更多的 JQuery,例如 UI 库中的手风琴。 我该如何让它发挥作用?

提前欢呼

I am relatively new to using jQuery and would like to use the load method to pull in content into my page as the site I am hosting with does not support any server side scripting.

I want to to be able to run more JQuery on the pages that are being pulled in (via the load method) such as the accordian in the UI library. How would I get this to work?

Cheers in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

Bonjour°[大白 2024-07-17 10:33:58

$.load 方法有一个回调

当数据返回时将调用此方法,以便您可以在此回调方法中实例化您的 ui 控件。

例如

   //Load html page with Accordian markup
    $('#someDiv').load(urlWithAccordian, function(){
        //Create Accordian
        $('#someUL').accordian();
    });

the $.load method has a callback.

This will be invoked when the data has been returned so you can instantiate your ui controls in this callback method.

For example

   //Load html page with Accordian markup
    $('#someDiv').load(urlWithAccordian, function(){
        //Create Accordian
        $('#someUL').accordian();
    });
浪漫人生路 2024-07-17 10:33:58

更改主机!您永远不必依赖 JavaScript 来处理像内容这样的基本内容!

Change hosts! You should never have to rely on JavaScript for something as rudimentary as content!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文