如何在创建管理面板时将PHP页面附加到div? [英] How to append a PHP page in to a div while creating an Admin Panel?

查看:89
本文介绍了如何在创建管理面板时将PHP页面附加到div?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

index.php





 <   div     class   =  dropdown-pages >  
< a href = > 页面< / a >
< div class = 子菜单页面 >
< < span class =code-leadattribute> a href = > 添加新< / a >
< / div >
< / div >







我的.js文件



 jQuery(document).ready(function()
{
jQuery(' 。下拉-网页的)。悬停(function()
{
jQuery( this )。children(' .sub-menu-pages')。toggle( 200 );
});
});

jQuery(document).ready(function()
{
jQuery( .sub-menu-pages)。click(function()
{
jQuery(' .test')。load(' ../ add_new.php ');
// alert('test');
});
});





当我点击Add New菜单时,它应显示一个页面(add_new。 php)内容区域内(在一个名为test的div中)

 <   div     id   =   content >  
< <温泉n class =code-leadattribute> div class = 徽标 > < img src = 我的四个Wallls.png > < sup > 您的信息中心< / sup > < / div >
< div class = 测试 > < / div >
< / div >

解决方案

添加# 像这样:

< a href =#>添加新< / a> 



为什么你想切换添加新链接吗?

../add_new.php表示它比index.php的当前目录高一级,是你想要的吗?



+++++++++++++++++++++++++++++++++ $ b似乎你根本不理解代码,更不用说javascript,jquery。建议你开始学习理解

1. jQuery学习中心 [ ^ ]

2. jQuery教程 [ ^ ]


 < script  > ;  
jQuery(document).ready(function()
{
jQuery( .new_project)。click(function()
{

jQuery(' < span class =code-string>#sidebar-left')。unbind(' click').click(function(e)
{
e.preventDefault();
e.stopPropagation();

var url = ' project_details_form.php' ;

jQuery.post(url,
function(data)
{
if ' '!== data)
{
jQuery(' #test')。empty()。html(data);
}
}
);
});
});
});
< / script >


index.php


<div class="dropdown-pages">
                <a href="#">Pages</a>
                    <div class="sub-menu-pages">
                        <a href="">Add New</a>
                    </div>
            </div>




my .js file

jQuery(document).ready(function()
{
jQuery('.dropdown-pages').hover(function()
{
jQuery(this).children('.sub-menu-pages').toggle(200);
            });
});

jQuery(document).ready(function()
{
    jQuery(".sub-menu-pages").click(function()
    {
                jQuery('.test').load('../add_new.php');
                //alert('test');
    });
});



When I click on Add New menu it should display a page(add_new.php) inside the content area(in A div called test)

<div id="content">
        <div class="logo"><img src="My Four Wallls.png"><sup>Your Dashboard</sup></div>
            <div class="test"></div>
    </div>

解决方案

add a "#" like this:

<a href="#">Add New</a>


Why do you want to toggle the "Add New" link?
The "../add_new.php" indicates that it is one level above the current directory of index.php, is that what you want?

++++++++++++ Round 2 ++++++

It seems that you do not understand the code at all, not to mention javascript, jquery. Suggest you start learning to understand
1. jQuery Learning Center[^]
2. jQuery Tutorial[^]


<script>
jQuery(document).ready(function()
{
    jQuery(".new_project").click(function()
    {

        jQuery('#sidebar-left').unbind('click').click(function(e)
        {
            e.preventDefault();
            e.stopPropagation();

            var url = 'project_details_form.php';

        jQuery.post(url,
            function(data)
            {
                if ('' !== data)
                {
                    jQuery('#test').empty().html(data);
                }
            }
        );
        });
    });
});
</script>


这篇关于如何在创建管理面板时将PHP页面附加到div?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆