English 中文(简体)
行政小组的动态内容
原标题:Dynamic content in admin panel

我目前正在为我建造一个地点的行政控制小组,一些博客正在启动。 我要让小组在左边盖一个菜单,即只开掉中心主页上显示的内容。 因此,菜单基本上由纽州组成,当一个纽州被点击时,我想要改变内容。 这样做是用javascript? 如果是的话,任何人都知道如何将其与html联系起来? 是否给标签上打着某种标识? 我知道我的问题可能似乎过于模糊,但在这一问题上的任何帮助都将受到高度赞赏。

问题回答

你们可以通过 j子这样做。 这将是这样的:

<head>
    <script type="text/javascript">
        function loadPage(thePage) 
        {
            $.ajax({
                type:  GET ,
                url: thePage,
                success: function(response) {
                     $( #main_content ).html(response);
                },
                dataType:  html 
            });
        }

        $(document).ready(function() {
            // I just imagine you have some php pages here
            $( #add_employee ).click = loadPage( AddEmployee.php );
            $( #show_employee ).click = loadPage( ShowEmployees.php );
        });
    </script>
</head>
<body>
    <div id="left_panel">
        <a href="#" id="add_employee">Add employee</a>
        <a href="#" id="show_employee">Show employees</a>
    </div>

    <div id="main_content">
        // This is your main content on the right of the admin panel
    </div>
</body>

你们可以使用简单的东西。 Tabs and Jquery. 我在这里创造了一个 de,。 http://jsfiddle.net/6kN5M/

如果你想要的话,基本上无视国家安全局的布局。 从标记中可以理解的主要事情是,重点强调第一个表/目录,它显示了第一个内容。 当你在另一个表格/目录上浮出时,这显示了另一个内容。 你可以像你一样增加许多表格。





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签