Custom stylesheet peculiarity

Hey! It aint that hard!
AndrewB
BIG GIANT HEAD I Get Free Beer
BIG GIANT HEAD I Get Free Beer
Posts: 2385
Joined: 12/09/01, 12:00 am
Location: USA
Contact:

Post by AndrewB » 08/17/03, 10:07 pm

Its 4:00AM so I'll make it short.

<a href="http://hackmaster451.tripod.com/default.html">This page</a> contains two links. the alternative link changes the page style from the default and the other changes it back. It works perfectly fine there and running locally, but on my <a href="http://www.tweakhardware.com/asptest/">"real site"</a> clicking the links don't do anything.

The how-to page for the set-up is <a href="http://www.alistapart.com/stories/alternate/">here</a>.

As I said, clicking the link does nothing on the server, and in IE it is said that there is an error on line 11 of the .js file. from the tripod site there, it works perfectly in both mozilla and IE, and there are no such error messages w/ the exact same code. Now that I've finally found something that does what i want, it doesnt want to work on the dogdanged server >:(
Keep Your Assets & ID Private! Can you afford not to?

SloppyGoat
BIG GIANT HEAD I Get Free Beer
BIG GIANT HEAD I Get Free Beer
Posts: 1778
Joined: 12/30/02, 12:00 am
Contact:

Post by SloppyGoat » 08/18/03, 4:43 am

It tells me there's expected objects missing on lines 15 & 16.

undefined
Senior Member I Get Free Beer
Senior Member I Get Free Beer
Posts: 214
Joined: 07/21/02, 12:00 am

Post by undefined » 08/18/03, 5:12 am

I could get it working by using the working (formatted) styleswitcher.js from the tripod site on the new site.

Don
Senior Member I Get Free Beer
Senior Member I Get Free Beer
Posts: 755
Joined: 10/10/02, 12:00 am
Location: Sydney

Post by Don » 08/18/03, 5:25 am

This page looks like it might have some relevance too; <br> http://www.alistapart.com/switcher.html

SloppyGoat
BIG GIANT HEAD I Get Free Beer
BIG GIANT HEAD I Get Free Beer
Posts: 1778
Joined: 12/30/02, 12:00 am
Contact:

Post by SloppyGoat » 08/18/03, 7:57 am

<!-- BBCode Quote Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class=postbody>Quote:</font><HR width=100% color=#333333 SIZE=1></TD></TR><TR><TD><FONT class=quote><BLOCKQUOTE>
On 2003-08-18 13:12, undefined wrote:
I could get it working by using the working (formatted) styleswitcher.js from the tripod site on the new site.
</BLOCKQUOTE></FONT></TD></TR><TR><TD><HR width=100% color=#333333 SIZE=1></TD></TR></TABLE><!-- BBCode Quote End -->
Maybe there's something wrong with the one on the dnld page? I was wondering that myself, but I didn't try it. Try using the one from the tripod site.

http://hackmaster451.tripod.com/styleswitcher.js
Does anybody really know what time it is?
The Grey Area - Tweaking Obsession

AndrewB
BIG GIANT HEAD I Get Free Beer
BIG GIANT HEAD I Get Free Beer
Posts: 2385
Joined: 12/09/01, 12:00 am
Location: USA
Contact:

Post by AndrewB » 08/18/03, 5:30 pm

ultraedit text comparison shows no differences. Previously, I was having problems with database permissions. Is it possible for IIS (TH's crappy server) to impose restrictions on this somehow? I tried using that code both as an ASP file and as an HTML file to the same effect.
Keep Your Assets & ID Private! Can you afford not to?

AndrewB
BIG GIANT HEAD I Get Free Beer
BIG GIANT HEAD I Get Free Beer
Posts: 2385
Joined: 12/09/01, 12:00 am
Location: USA
Contact:

Post by AndrewB » 08/18/03, 6:29 pm

OK I think I know where the problem is, but I think i might need help fixing it, or at least how to determine fixing it. The tripod site parses the JS as-is, e.g. in a cascading fasion just like it was written. My site however parses the JS in two very long unbreaking lines. I think it would make it all a single stream if it could, but I think it hits some limit and has to finish on a separate line. The IE error code from TH (the 2 long lines) is as follows:

Line: 2
Char: 1558
Error: Expected ';'
Code: 0
URL: http://www.tweakhardware.com/asptest/

When you click one of the links, a new error is generated:

Line: 11
Char: 1
Error: Object Expected
Code: 0
URL: http://www.tweakhardware.com/asptest/
Keep Your Assets & ID Private! Can you afford not to?

AndrewB
BIG GIANT HEAD I Get Free Beer
BIG GIANT HEAD I Get Free Beer
Posts: 2385
Joined: 12/09/01, 12:00 am
Location: USA
Contact:

Post by AndrewB » 08/18/03, 7:26 pm

installed IIS on my localhost and the same problem occurs. I installed the MS script debugger, and aparently it doesnt like onclick="setActiveStyleSheet('default');
for some reason.
Keep Your Assets & ID Private! Can you afford not to?

AndrewB
BIG GIANT HEAD I Get Free Beer
BIG GIANT HEAD I Get Free Beer
Posts: 2385
Joined: 12/09/01, 12:00 am
Location: USA
Contact:

Post by AndrewB » 08/18/03, 8:18 pm

As it turns out, normal .html files work fine with external .js files on my system but not on the TH server. Strangely enough, it will work just fine if its imported from somewhere else (in this case tripod.com). the CSS files can be on the server and work just fine however. This is as far as i can tell a configuration problem with IIS. Is there a way to prevent IIS from mangling JSS code and just serve it directly instead of trying to parse it or whatever the helvetica its doing? In the meantime, I'm going to work on some cool styles. *Finally*, there will soon be some cool style options for users.

What I plan to do, is use a JS or ASP dropdown menu which in which users can select what style they like.
Unlike 99.999% of the other user-defined CSS interfaces out there, this one will be simple and let you choose a complete interface style rather than having to manually set all the options manually. Mostly the options will deal with color, but it could also involve font style/size combinations as well.

For example, there would be a 'Default' theme (the current one), and other themes ('Orange', Black-n-White', etc) that you can choose from. They are all stored in a cookie lasting 5 days, so the colors will stick if you reload the page or visit others on the site.

Any custom code i write for this I'll put up for grabs either under the GPL or a "BSD-wannaB" license because I apreciate the help, and I feel philanthropic and just genuinely want to save others the insane ammounts of time and energy it took to get this far with the idea. All other code (there is a lot, namely the JS file, from WebMonkey) will be under its original license(s) of course.
Keep Your Assets & ID Private! Can you afford not to?

brantgurga
Senior Member (Entitled To Root Beer)
Senior Member (Entitled To Root Beer)
Posts: 529
Joined: 01/08/02, 12:00 am
Location: Indianapolis, IN
Contact:

Post by brantgurga » 08/20/03, 2:19 am

Mozilla gives:

Code: Select all

Error: missing ; before statement
Source File: http://www.tweakhardware.com/asptest/styleswitcher.js
Line: 1, Column: 27
Source Code:
etActiveStyleSheet(title);}window.onunload = function(e) {  var title = getActiveStyleSheet();  createCookie("style", title, 365);}var cookie = readCookie("style");var title = cookie ? cookie : getPreferredStyleSheet();setActiveStyleSheet(title);
on page load
Brant Gurganus

AndrewB
BIG GIANT HEAD I Get Free Beer
BIG GIANT HEAD I Get Free Beer
Posts: 2385
Joined: 12/09/01, 12:00 am
Location: USA
Contact:

Post by AndrewB » 08/20/03, 6:59 am

latest is at <a href="http://www.tweakhardware.com/defaultcss.asp">this location</a>. I have the JS file hosted on this other free hosting site, which doesnt try to prevent 'leaching' like tripod does, however I'd like to get it working on the server ideally. We shall see.

SloppyGoat
BIG GIANT HEAD I Get Free Beer
BIG GIANT HEAD I Get Free Beer
Posts: 1778
Joined: 12/30/02, 12:00 am
Contact:

Post by SloppyGoat » 08/20/03, 8:54 am

I run a IIS server, and have yet to experience any problems with any JS. It's most probably a config problem in IIS.

Actually, I just tested it on my server and it works fine. You have to have something configured wrong. Not sure what though. I'm no expert, unfortunately.
See if it works on your side of the router.

Let me know when you've checked it. I'm going to remove it after that.

<font class=editedby>[ This Message was edited by: SloppyGoat on 2003-08-21 01:33 ]</font>

AndrewB
BIG GIANT HEAD I Get Free Beer
BIG GIANT HEAD I Get Free Beer
Posts: 2385
Joined: 12/09/01, 12:00 am
Location: USA
Contact:

Post by AndrewB » 08/20/03, 12:15 pm

it does work there and inside my firewall- when the JS url is directed to another host. Try copying the JS to your own server, and changing the script url in defaultcss.asp. I do know its a config problem, but the question is, "what?".

SloppyGoat
BIG GIANT HEAD I Get Free Beer
BIG GIANT HEAD I Get Free Beer
Posts: 1778
Joined: 12/30/02, 12:00 am
Contact:

Post by SloppyGoat » 08/20/03, 12:48 pm

Ah yeah...I didn't do that. I had the script there, but forgot to change the asp. Done. And it still works on my end. How 'bout there?

<font class=editedby>[ This Message was edited by: SloppyGoat on 2003-08-20 20:51 ]</font>

AndrewB
BIG GIANT HEAD I Get Free Beer
BIG GIANT HEAD I Get Free Beer
Posts: 2385
Joined: 12/09/01, 12:00 am
Location: USA
Contact:

Post by AndrewB » 08/20/03, 3:56 pm

nope. Don't suppose you can give my any specific things to look for unless you're an absolute pro with IIS huh? That POS does it the hard way and doesnt seem to have any config files- its all registry crap (correct me if I'm wrong).

BTW, how do you think orange would look as one of the color choices?
Keep Your Assets & ID Private! Can you afford not to?

Post Reply