473,809 Members | 2,908 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

(Javascript) calling user requested div content to another div?

4 New Member
I am re-designing a website which currently makes use of Frames. (I want to replace them with something more convenient.)

It has a layout page, a menus frame and content frame for various content pages (also a links frame.)

What I want to do is make the site completely dynamic. As in, I want to keep the layout, content, menu and links areas in separate files so that updating is easy. Or at least separate the layout from the content so that changing it only needs to be done on one page

Here is an image to make the layout clearer:

http://img520.imageshack.us/img520/4465/layoutic8.gif

I looked into using PHP, made an index page and menus.php include page and put divs instead of Frames, but it all started to look too uncessecarily complicated using an IF/Case statment with the GET variable function.

Plus, it requires a page refresh before any content is even loaded...

The problem was with using includes, I would need to repeat the layout code with the content.

I require a situation that when the user clicks a menu in the menus div the content would be produced for the right page in the content div. (Almost like an Ajax application yet possibly with a page refresh.) The menus area could even be on the same page as the layout.

I read in a search that Javascript was a better way to achieve this. I can't really use Ajax though, the host does not support it.

I am really surprised that I cannot not find a more benifitial way to do this without Frames...

If anyone can suggest how I can achieve this it would be gladly appreciated.

I hope if anyone can provide an answer, this will come up in a search if people are looking for similar things too.
Oct 15 '07 #1
5 1775
acoder
16,027 Recognized Expert Moderator MVP
Welcome to TSDN!

Do you need to get the content of the content div from the server? If not, you could have all the divs on the page, but hidden except the default one. When a link is clicked, the current one is hidden and the div corresponding to the link is shown.

You can use style.display set to 'block' and 'none' to show and hide.
Oct 15 '07 #2
Phantom
4 New Member
Thank you for the welcome.


This seems like it could work, but I think that suggests the user would have to load all the site content on the first page...

Maybe it would be better if I asked the same question for a PHP solution again.
Oct 15 '07 #3
acoder
16,027 Recognized Expert Moderator MVP
What do you mean when you say you can't use Ajax? If you can use PHP, you should be able to use Ajax.
Oct 15 '07 #4
Phantom
4 New Member
I thought I needed ASP support, for some reason.

Nevermind, in this case would it be easier to do in Ajax and are there any tutorials I could follow that would allow me to set up this calling system from menu to content?
Oct 15 '07 #5
acoder
16,027 Recognized Expert Moderator MVP
See this example - the example server-side language is ASP, but it can easily be replaced with PHP.

Also check out the Ajax tutorial links in Offsite Links.
Oct 15 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

14
1687
by: MartinRinehart | last post by:
I can load a dialog by loading an HTML page or by constructing the dialog with JavaScript. What should I be thinking about when I look at this choice?
0
9600
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10375
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7651
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6880
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5548
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5686
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4331
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3011
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.