Hello. I am new here, and I am sorry if this discussion has already been posted and if I posted it in the wrong category :(. I will get to the point and my problem which doesn't let me sleep at night xD.
First I will explain what I want to do. I want to load a php file a div located in the current structure of the website. You might say that this is no problem, but things get a bit complicated. To get a perfect understanding the layout of my website is as current :
My navigation is at the top of the page. Below the navigation I have 2 containers ( divs ). One includes a menu, which is located on the left side, and on the right side I have the content in which should the php file load when a link from the left menu is clicked. I have tried with AJAX, jQuery and couldn't get it to work. I might have done something wrong, but I don't know where. So basically I want to load a php file into the right container after clicking a link from the left container without leaving the current page.
Hope you can help me out a bit, or point me in the right direction. Thank you for your time, and again I am sorry if I posted it in the wrong category.
Thank you for your fast response. I have inserted the script at the end of the body tag, and added the CDN jQuery in the head tag. Changed the placeholders matching my div id's, but it will not load the requested page. Probably I am doing something wrong?
Here is an example http://jsfiddle.net/L9ghH/22/ . Instead of using a .php file, I loaded one of jsfiddle's local CSS stylesheets (Don't tell them :D). Because .load() only works for files on the same server that are accessed locally, In other words without " http:// ".
That will come in handy :). Thank you mmoustafa. I think I know where the problem is. The thing is that I am trying to load with a defined admin folder. For example : HTTP_SERVER_ADMIN. And I was trying to load with the first js you posted like this :
<li> .... </li> </ul> </div> <!-- End of grid_a" -->
<div class="grid_b" <div class="box"> <div class="header"><h3>Some text</h3> <div id="low-content" class="low_content"> <p>Some other text</p> </div> <!-- end of low_content --> </div> <!-- end of box --> </div> <!-- end of grid_b --> </div> <!-- end of content -->
Now, using the js mmoustafa posted it should go like this...and correct me if I am wrong :
I will get to the point and my problem which doesn't let me sleep at night xD.
First I will explain what I want to do. I want to load a php file a div located in the current structure of the website. You might say that this is no problem, but things get a bit complicated. To get a perfect understanding the layout of my website is as current :
My navigation is at the top of the page. Below the navigation I have 2 containers ( divs ). One includes a menu, which is located on the left side, and on the right side I have the content in which should the php file load when a link from the left menu is clicked. I have tried with AJAX, jQuery and couldn't get it to work. I might have done something wrong, but I don't know where. So basically I want to load a php file into the right container after clicking a link from the left container without leaving the current page.
Hope you can help me out a bit, or point me in the right direction. Thank you for your time, and again I am sorry if I posted it in the wrong category.
Have a good day,
ShiDomY
Add this at end of < body > tag.
Make document load on click, placeholders below are self explanatory.
I have inserted the script at the end of the body tag, and added the CDN jQuery in the head tag. Changed the placeholders matching my div id's, but it will not load the requested page. Probably I am doing something wrong?
Edit: Still cannot get it to work, and don't know where I am doing wrong. When clicking the link from the div nothing happens.
Instead of using a .php file, I loaded one of jsfiddle's local CSS stylesheets (Don't tell them :D). Because .load() only works for files on the same server that are accessed locally, In other words without " http:// ".
And I think that might be wrong, or JS doesn't allow defined locations of folders :-??
Edit: Maybe I should've done this in the first place, and show you how my website is structured.
Now, using the js mmoustafa posted it should go like this...and correct me if I am wrong :
I might be blind on this one, but I just cannot see what is wrong.
Please mark the discussion solved.
@mmoustafa greate work bro...