ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Acceptable solution (provided that users without Javascript can still navigate) but bad implementation, because the write() function is deprecated in XHTML, because DOM manipulation has now to be done via the DOM functions.
Acceptable solution (provided that users without Javascript can still navigate) but bad implementation, because the write() function is deprecated in XHTML, because DOM manipulation has now to be done via the DOM functions.
Didn't know that. Is there a new standard way of doing it
from javascript? Do u have a link?
dubya, wish u could use php and this would be cake.
And btw, if you want to just include the same menu on
a bunch of pages you could just save the code in a
javascript file
I would recommend against this--simply because *I* normally disable javascript (but I guess I'm not the only one).
The point is: never, ever, *rely* on javascript. Use it for `extra' services, like displaying whether or not a form field is valid (but validate it on the server side too), or, say, sorting some data.
Another option is to use xml and xslt and rely on the client to translate it--but since that's a pretty new technology, it's gonna break in a *lot* of browsers.
yes, i forgot about people who turn off js (even though
document.write() isn't really that malignant).
dubya, in the abscence of php, u may want to use perl.
If you have an html file 'foo.html' and you want to have
your side menu taken out of that file so you can use it in
others, make a cgi script foo.cgi something like this:
Code:
#!/usr/bin/perl
# this is the file foo.cgi, inserting menu from menu.html
# into the middle of the old file foo.html
use strict;
my $menu= `sideMenu.html`; #file with side menu code
my $foo_part_a= <<<END
blah ...
(put first part of foo.html until the menu here)
END;
my $foo_part_b= <<<END
blah ...
(remainder of file foo.html goes here)
END;
print "$foo_part_a $menu $foo_part_b";
Another thing, is there a way I can define classes of links within my style sheet that go to a certain page?
For example, if I reference Linux a lot and want to link on the word Linux to www.linux.org, can I define a class called a.linux that will open that website in a popup window? I've tried the following, but it doesn't work for me:
You might want to look into a host that supports PHP. Getting your own domain plus a hosting account can be very cheap these days. Before I switched to being my own reseller (for a mere US$20/month) I had a few lower volume hosts which only charged US$2.50 or so per month when I purchased annual contracts.
In that sense you can then run a CMS (content mangagement system) on your site. I do this on almost all my sites. You spend a little time setting it up then just go. Updating content is easy and you just need to make sure you back up your database once in a while.
Some good CMS systems are Drupal , TikiWiki , PHP Nuke , and my personal favorite, Xoops . (I use Xoops on my personal site.)
You can use all of the CMS systems listed for free, and I'm sure there are many others I haven't included. The nice thing is, once they're up, you pretty much don't have to maintain much - unless you want to.
Google for cheap web hosts php, and you'll find a bazillion of them. Many will also throw in one of the above CMS systems along with your hosting.
Originally posted by jonaskoelker Another option is to use xml and xslt and rely on the client to translate it--but since that's a pretty new technology, it's gonna break in a *lot* of browsers.
It isn't that new, and it does actually work well with IE6 and Firefox (it is said to work with slightly older versions of IE too); I don't know for Opera/Konqueror.
I have used this technique on my web site for the Atom and RSS1 feeds, and according to my server stats, it will be usable by almost all my visitors (IE + Firefox + robots : 90% or so).
This technique would allow you to do whatever you want, based on any attribute. Your thing about the "linux" class for example.
dubya, yes, you name the file whatever you want (just treat it
like you would an html file, the web server will handle it properly),
then the url to it for your visitors would be just like html:
Code:
http://www.myhost.com/myWebDir/index.cgi
Also take a look at PerfectReign's suggestion, do that google
that was mentioned.
theYinYeti, about using xslt, if you use this you can only send the
client an xml file right? So how would you embed this in (x)html?
If you have a link I'd appreciate it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.