在 jqueryui ajax 选项卡中使用 Google Table

发布于 2024-07-25 03:31:28 字数 917 浏览 2 评论 0原文

好吧,这个场景有点复杂,但我会尽力解释它。

我正在使用 Google Ajax Libraries API 将 jquery 和 jqueryui 加载到页面上,因此我的页面顶部如下所示。

<head>
    <title>TBTNet</title>
    <link rel="stylesheet" type="text/css" href="_css/style.css">
    <link rel="stylesheet" type="text/css" href="_css/jquery-ui.css">

    <script src="http://www.google.com/jsapi"></script>

    <script>
        google.load("jquery", "1"); 
        google.load("jqueryui", "1"); 
        google.load('visualization', '1', {packages: ['table']});
    </script>

</head>

如您所见,我也在使用 Google Visualizations Table API。 在页面上,我有一个 jqueryui 选项卡控件,它使用 AJAX 将请求的页面加载到选项卡中。 在请求的页面上,我有相同的 html 头,因此有相同的 javascript。 在请求的页面上有一个谷歌表格控件。 当我在这种情况下运行页面时,选项卡显示空白页面。 当我单独运行请求的页面(不通过ajax调用它)时,谷歌表格控件显示得很好。

我对 AJAX 相当陌生,所以我可能错过了一些东西。 任何帮助将不胜感激。

——凯尔

编辑:有人吗?

Okay, this scenario is a little complicated, but I will try to explain it as best I can.

I am using the Google Ajax Libraries API to get jquery and jqueryui onto the page, so the top of my page looks like this.

<head>
    <title>TBTNet</title>
    <link rel="stylesheet" type="text/css" href="_css/style.css">
    <link rel="stylesheet" type="text/css" href="_css/jquery-ui.css">

    <script src="http://www.google.com/jsapi"></script>

    <script>
        google.load("jquery", "1"); 
        google.load("jqueryui", "1"); 
        google.load('visualization', '1', {packages: ['table']});
    </script>

</head>

As you can see I am also using the Google Visualizations Table API. On the page I have an jqueryui tabs control that uses AJAX to load the requested page into the tab. On the requested page I have the same html head, so the same javascript. On the requested page there is a google table control. When I run the page under this scenario the tab displays a blank page. When I run the requested page by itself (without calling it through ajax) the google table control displays just fine.

I am fairly new to AJAX so I may just be missing something. Any help would be greatly appreciated.

--Kyle

EDIT: Anyone?

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

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

发布评论

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

评论(1

隐诗 2024-08-01 03:31:28

事实证明这个问题的答案非常简单,尽管我仍然无法解释它为什么有效。 我所要做的就是将可视化负载移到两个 jquery 之前,现在一切正常。

<head>
    <title>TBTNet</title>
    <link rel="stylesheet" type="text/css" href="_css/jquery-ui.css">
    <link rel="stylesheet" type="text/css" href="_css/style.css">

    <script src="http://www.google.com/jsapi"></script>

    <script>
        google.load('visualization', '1', {packages: ['table']});
        google.load("jquery", "1"); 
        google.load("jqueryui", "1"); 
    </script>

    <!--<script src="_includes/js/jquery-ui.min.js"></script>-->

</head>

The answer to this turned out to be very simple, though I still cannot explain why it worked. All I had to do was move the visualizations load before the two jquery ones and now everything works just fine.

<head>
    <title>TBTNet</title>
    <link rel="stylesheet" type="text/css" href="_css/jquery-ui.css">
    <link rel="stylesheet" type="text/css" href="_css/style.css">

    <script src="http://www.google.com/jsapi"></script>

    <script>
        google.load('visualization', '1', {packages: ['table']});
        google.load("jquery", "1"); 
        google.load("jqueryui", "1"); 
    </script>

    <!--<script src="_includes/js/jquery-ui.min.js"></script>-->

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