English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

My HTML-written website has several pages with similar codings written for the appearance and functioning of the top navigation bar. How can I extract that part of the codes by Javascript so that when I want to make changes to the top navigation bar, I can just change that external file for once and don't need to make the same changes repeatedly for every pages. And also can I preview these Javascript-webpages in my own computer before publishing it to the webhosting computer. Thanks a lot in advance.

2007-09-22 19:39:27 · 6 answers · asked by Anonymous in Computers & Internet Programming & Design

Thank you for the iframe advice. But I've heard that frame is not good for seach engines, is it? If frame is really not good for search engines, is there other way to achieve my end?

2007-09-22 20:47:39 · update #1

6 answers

Yes, there are other ways. As they are reputed to say in AOL-land, "you have mail." The sample is kind o' big to insert and has some personal info, I prefer not to post publicly here.

Should be all you need.

2007-09-23 02:42:36 · answer #1 · answered by richarduie 6 · 0 0

Actually you don't need javascript for this. Define an iframe tag with the source as the html page with the navigation bar. In fact, if you have a dynamic site instead of static pages, you can build the navigation bit from a different page template, and receive the same results.

Edit: The longer more difficult option is that you use javascript to provide the innerHTML of a div tag. Or you put a div tag at the top of your page. Then you load the html file as an xml file and parse it to the location that you want and then write a small javascript loop to go through all the tags as elements and insert them as children of the said div tag. You should be able to figure it out. If you have any problems, PM me.

2007-09-22 19:48:26 · answer #2 · answered by StormBringer 3 · 0 0

Is the webhosting PHP, JSP, ASP.NET? Or even more traditional static SSI and CGI? Those have mechanisms for external files the simplest type would fill your need, in one simple line no less.

Otherwise importing back via other methods are doable just not simple.

As far as extracting parts to external file for the use of either above two method can be done programmatically only if your HTML is xHTML (XML conformed) via some simple XSLT in variation of an "identity" template that dump things you don't want, accessing XSLT via Java or any modern languages or special reader software.

2007-09-23 09:32:41 · answer #3 · answered by Andy T 7 · 0 0

extract part coding html webpage external file

2016-02-02 05:39:14 · answer #4 · answered by Melli 4 · 0 0

Could be wrong here but it looks like you're missing the css file extension when you declare the location of the file. Try

2016-03-18 22:28:39 · answer #5 · answered by Anonymous · 0 0

Hello,

Take a look at this site it might help you
http://webhostingsecretsonline.com

Best of Luck

2014-03-16 12:28:18 · answer #6 · answered by Anonymous · 0 0

fedest.com, questions and answers