2

好的,这个场景有点复杂,但我会尽力解释它。在jqueryui中使用Google Table ajax选项卡

我正在使用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调用它)时,Google表格控件显示得很好。

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

- 凯尔

编辑:任何人?

+0

你可以发布你的源代码的例子吗? – 2009-06-23 23:54:34

回答

1

答案很简单,尽管我仍然无法解释它为什么起作用。我所要做的只是在两个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>