Wrox Programmer Forums
|
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 2nd, 2005, 10:47 PM
Registered User
 
Join Date: Feb 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default HTML help

Hello, I'm pretty new at HTML and I'm just starting to get into more advanced things. Anyways, on the site I'm building now I'm making it with a menu bar to the left, and then a bar that's going to have something else in it to the right, and in the middle is the actual webpage. http://prototypepacifist.50megs.com is an example of what I'm talking about. Well right now I'm having to make changes to every page if I want it to show up on all of the pages, and I was wondering if there was a way I could make the menu bar and the bar on the right as one html file or something, and then making separate html files that will go in the middle of the pages?

Also, I'm putting some pictures and some artwork up on the site as thumbnails, and then having the pictures actually open up in a new empty window when you click on the thumbnail. Is there a way to do this and have the new window automatically fit around the image, without actually having to define the size of the new window?

Thanks for all the help I may recieve. I appreciate all of it.

 
Old February 3rd, 2005, 01:40 AM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Vadivel Send a message via Yahoo to Vadivel
Default

If you are using only HTML then make use of Client side includes. Say for example you want copyright information to appear in all pages. Just make use of document.write and create a .js file. As you can't have plain html directly inside .js file ... we are using document.write. Now you can make use of <script src> tag to include this copyright info in all other pages in your site.

File 1:
<html>
   <head>
      <title>Demo of client side include</title>
   </head>

<body>
   <p>Below line would be INCLUDED from another file</p>
      <script src="FileInclude.js" type="text/javascript"></script>
   <p>Above line is included from another file. But I belong to this file only :)</p>
</body>
</html>

File 2:
Just write below line of code in notepad and save it as "FileInclude.js"

document.write("<b>This text is coming from another file</b>")

Best Regards
Vadivel

MVP ASP/ASP.NET
http://vadivel.thinkingms.com
 
Old February 3rd, 2005, 02:14 AM
Registered User
 
Join Date: Feb 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you. I appreciate your help very much.

I just found this site yesterday, and I have to say it's one of the greatest sites I've ever stumbled upon. Everyone seems eager to help, and they do it in a great way.

*edit*What you said works, but I'm looking for something almost exactly like what you told me, only something that will let me use html code in the .js file. Is there any way this can be done, or am I being difficult?

Will Java programming help me with stuff like this, because I'm just starting a Java Programming book, but it's not about HTML. Is it the same either way, or are they different?
 
Old February 3rd, 2005, 04:50 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Sorry, but I don't agree.

"JavaScript includes" are a plaything, nothing more. Users without JavaScript support won't be able to navigate your site. Neither will search engines. If you can't use server side scripting, rather find a way to easily generate the updated files on your computer. After all, it's just a matter of major Find & Replace.

(o<
//\ =^..^=
 
Old February 3rd, 2005, 05:10 AM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Vadivel Send a message via Yahoo to Vadivel
Default

Server side includes are also there. You can use server side includes in ASP. (Search for "#include" in google).

Sorry I have no clue about Java as I have not worked on that.

Best Regards
Vadivel

MVP ASP/ASP.NET
http://vadivel.thinkingms.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove orphaned html elements from html string pauliehaha C# 2008 aka C# 3.0 2 June 30th, 2008 09:40 AM
html:errors and html:messages sparun1607 Struts 0 November 23rd, 2006 08:34 AM
Converting an HTML Server Control to HTML Control gratisaccount ASP.NET 1.0 and 1.1 Basics 2 August 7th, 2006 12:29 AM
Can you preload child html files to 1parent html? bekim Javascript How-To 4 January 22nd, 2005 04:17 PM
html Moharo HTML Code Clinic 3 August 16th, 2003 12:10 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.