Hi, when I try to load a page inside tabs, I get only the content. The
scripts are not activated. 

Here is my code:

main page (with tab):

    <script type="text/javascript"
src="/Scripts/jquery-1.4.1.min.js"></script>
    <script type="text/javascript"
src="/Scripts/jquery-ui-1.8rc3.custom.min.js"></script>
    <link type="text/css"
href="/css/ui-lightness/jquery-ui-1.8rc3.custom.css" rel="stylesheet" />        

    <script type="text/javascript" >
        $(document).ready(function() {
            $("#tabs").tabs();
        });
    </script>
...
                 <div id="tabs">
                        <ul>
                                <li> #tabs-1 Preloaded </li>
                                <li> /Home/About Saudações </li>
                                <li> /Home/Incluir Incluir </li>
                                <li> /Home/Listar Listar </li>
                        </ul>
                        <div id="tabs-1">
                                <p>test</p>
                        </div>
                </div>



page loaded:

<%@ Page Language="C#"
Inherits="System.Web.Mvc.ViewPage<IEnumerable<Benner.Saude.Business.Cliente>>"
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>

<html xmlns="http://www.w3.org/1999/xhtml"; >
<head runat="server">
    <title>Listar</title>
    <script type="text/javascript">

        $(function() {
            initializeTable();
            $("#summits A").live("click", function() {
                $.get($(this).attr("href"), function(response) {
                    $("#summits").replaceWith($("#summits", response));

                    initializeTable();

                    // Respect the (un)checked state of the "show heights"
check box
                    if (!$("#heights")[0].checked)
                        $("#summits td:nth-child(2)").hide();
                });
                return false;
            });
        });

        function initializeTable() {
            $("#summits tr:nth-child(even)").css("background-color",
"yellow");

            // Deletion confirmations
            $("#summits form[action$='/DeleteItem']").submit(function() {
                var itemText = $("input[name='item']", this).val();
                return confirm("Are you sure you want to delete '" +
itemText + "'?");
            });

            $("#btCarregar").live("click", function(event, ui) {
                $(inserido).load("/home/listar");
            });
        }        
    </script>
</head>
<body>
    <div>
        <div id="summits">
            <table>
                <tr>
                    <th>nome</th>
                    <th>idade</th>
                    <th>regiao</th>
                    <th>Carregar</th>
                    <th>Ação</th>
                </tr>

            <% foreach (var item in Model) { %>
            
                <tr>
                    <td><%= Html.Encode(item.nome) %></td>
                    <td><%= Html.Encode(item.idade) %></td>
                    <td><%= Html.Encode(item.regiao.nome) %></td>
                    <td> Preloaded </td>            
                    <td>
                        <% using (Html.BeginForm("DeleteItem", "Home"))
                           { %>
                            <%= Html.Hidden("item", item.nome)%>
                            <input type="submit" value="Excluir" />
                            <% } %>
                    </td>                    
                </tr>
            
            <% } %>

            </table>
            
              Page:
              <%= Html.PageLinks((int)ViewData["currentPage"],
                               (int)ViewData["totalPages"],
                               i => Url.Action("Listar", new {page = i}))%>
            
            
            
        </div>
    </div>
    <p>This page generated at <%= DateTime.Now.ToLongTimeString() %></p>
    <div id="inserido"></div>
</body>
</html>


-- 
View this message in context: 
http://old.nabble.com/Tab-loading-%28via-ajax%29-another-page-with-its-own-scripts.-tp27988776s27240p27988776.html
Sent from the jQuery UI Discussion mailing list archive at Nabble.com.

-- 
You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to jquery...@googlegroups.com.
To unsubscribe from this group, send email to 
jquery-ui+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=en.

Reply via email to