Click here to Skip to main content
15,867,594 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
index.php


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



my .js file

C#
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)
XML
<div id="content">
        <div class="logo"><img src="My Four Wallls.png"><sup>Your Dashboard</sup></div>
            <div class="test"></div>
    </div>
Posted
Updated 5-Nov-14 19:21pm
v4
Comments
Sergey Alexandrovich Kryukov 6-Nov-14 0:30am    
What is "not working"? I cannot see any code.
The question doesn't seem to make much sense: PHP is executed on server side, and "div" is HTML. You don't "append" one to another.
—SA
Prava-MFS 6-Nov-14 0:47am    
Please add the code, you tried so far to get a clear idea, what you are asking.
Janardhanam Julapalli 6-Nov-14 1:11am    
I am trying my best to align the code but cant do it!
Janardhanam Julapalli 6-Nov-14 1:12am    
now is it okay to understand?

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[^]
 
Share this answer
 
v3
Comments
Janardhanam Julapalli 6-Nov-14 2:51am    
even I tried with only add_new.php.
Peter Leow 6-Nov-14 3:06am    
if the 'index.php' and 'add_new.php' are in the same directory, then it should be load('add_new.php').
Janardhanam Julapalli 6-Nov-14 2:52am    
is there a facility to share a screen shot here?
Janardhanam Julapalli 6-Nov-14 3:30am    
http://jsfiddle.net/Janardhanam/sbot73L9/
look at this fiddle please
Janardhanam Julapalli 6-Nov-14 3:56am    
Both files are in the same directory only.I am totally upset that I cant crack this.Yesterday It loaded in the content div and I don't know what happened after that.Please anyone help me!
C#
<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>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900