Log in

View Full Version : What kind of code is this???



TheJoshMan
11-22-2006, 08:22 AM
:confused:
Hey, I was pilfering through the code of a site that I like to try to get inspiration from... and I guess you could call me stupid... But I can't figure out what kind of code this is...


<a href="?cssfile=/195/195.css&amp;page=0" title="AccessKey: a" accesskey="a">Dazzling Beauty</a>

I like the idea behind the function... It loads a different stylesheet into the current page... but I can't figure out what kind of code it is or how to implement something similar myself... Any help would be greatly appreciated.

BLiZZaRD
11-22-2006, 09:59 AM
It's HTML, and if you look in the <head> section you will most likely see reference to X different CSS files. Where X is the number of links like that one.

This is just a guess though. If you could supply the link to the page we could tell you more.

Try this link though if I am correct: http://www.dynamicdrive.com/dynamicindex9/stylesheetswitcher.htm

Twey
11-22-2006, 05:21 PM
It's a link to a server-side script. cssfile and page are two GET variables being passed to it.

TheJoshMan
11-22-2006, 11:18 PM
It's a link to a server-side script. cssfile and page are two GET variables being passed to it.

Ok, so Here's (http://www.csszengarden.com) the link to the page I'm talking about... So do you know how I might be able to implement something like that into my page? Preferably without using javascript... that's what threw me about that code... It didin't look like javascript. I was thinking it was PHP maybe???

Twey
11-23-2006, 06:11 PM
It's simply a link. Nothing special. The link points to a server-side script (possibly PHP) which generates a link to a CSS file based on the parameter passed to it.

djr33
11-23-2006, 11:39 PM
Basically, that links just to the current page.
It sends the certain cssfile to it, so that it will use that cssfile, and the "page", so that it will generate that "page".

PHP or another serverside script takes those values and does stuff, such as inserting that css and outputting that page.

It's easy enough to send the values, but if you want to looking into coding like that, you'll need to learn about php.
I really like PHP, and it's not that complex, but certainly a bit more so than html.