473,503 Members | 2,159 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Permanently changing Stylesheet using Javascript

Hi,

I would like to be able to write some code in Javascript preferably
(PHP is also all right) which allows the admin of a website to be able
to change stylesheet attributes from a GUI browser interface without
having them to change the text file themselves. (i.e., working on the
supposition that the admin is IT illiterate). Simple things like
table heading colours, backgrounds, font sizes need to be changed this
way.

The browser should then read from the changed textfile the next time
the site is refreshed and it should therefore be permanent. Is this
at all possible? If so, how do I update the textfile?

Any help would be appreciated.

Many thanks,

Jacqueline
Jul 20 '05 #1
6 3140
Jacqueline hu kiteb:
Hi,

I would like to be able to write some code in Javascript preferably
(PHP is also all right) which allows the admin of a website to be able
to change stylesheet attributes from a GUI browser interface without
having them to change the text file themselves. (i.e., working on the
supposition that the admin is IT illiterate). Simple things like
table heading colours, backgrounds, font sizes need to be changed this
way.

The browser should then read from the changed textfile the next time
the site is refreshed and it should therefore be permanent. Is this
at all possible? If so, how do I update the textfile?


Cant be done in javascript. Javascript cant write to a file (except in
cookies), although it can generate text which can then be c&p into a
text file.
--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk

Jul 20 '05 #2
Shame it cannot be done in Javascript, but I guess I understand the
reasons for this - being a client side language I guess the security
risk would be huge!!

Have been looking at doing it in PHP, and have come up with two
distinct ways of doing this:-

1) PHP creates stylesheet text file based on entries on form on
webpage.
2) MySQL database table stores key/value pairs for stylesheet
attributes, then a function goes through the table and creates the
stylesheet on the fly (i.e., every webpage needing the stylesheet runs
the function at the top).

Any suggestions on which would be the most efficient/easiest to
implement etc. (or any other ideas on how to do this!!) ?

Many thanks,

Jacqueline

"Fabian" <la****@hotmail.com> wrote in message news:<br************@ID-174912.news.uni-berlin.de>...
Jacqueline hu kiteb:
Hi,

I would like to be able to write some code in Javascript preferably
(PHP is also all right) which allows the admin of a website to be able
to change stylesheet attributes from a GUI browser interface without
having them to change the text file themselves. (i.e., working on the
supposition that the admin is IT illiterate). Simple things like
table heading colours, backgrounds, font sizes need to be changed this
way.

The browser should then read from the changed textfile the next time
the site is refreshed and it should therefore be permanent. Is this
at all possible? If so, how do I update the textfile?


Cant be done in javascript. Javascript cant write to a file (except in
cookies), although it can generate text which can then be c&p into a
text file.
--

Jul 20 '05 #3
Jacqueline wrote:
Shame it cannot be done in Javascript, but I guess I understand the
reasons for this - being a client side language
No, and Fabian's answer was incorrect. It *can* be done with JavaScript.
However, it *cannot* be done with *client-side* JavaScript.
I guess the security risk would be huge!!


Exactly.
PointedEars
Jul 20 '05 #4
On 12 Dec 2003 08:27:23 -0800, ja*******@hotmail.com (Jacqueline)
wrote:
Hi,

I would like to be able to write some code in Javascript preferably


Jacqueline

Check my site, got to the controlpanel,
and see it this is what you want ....

--

find clausen
www.photopress.dk
Jul 20 '05 #5
You can do this using server-side javascript (eg. with ASP).
By using an include file that keeps the style sheet,
user can be allowed to change it by posting info from a form.
Kien
Jul 20 '05 #6
Jacqueline,

If it's the admin, why don't he/she just upload a new stylesheet file?
You said the person must be "IT illiterate" so I think you can assume he/she
can write CCS files. Am I right?
If you don't want the admin to change all posible style things (table width
etc.)
Just make two stylesheets and let him/her only edit one (and load that one
first).

Wouter
Jul 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
10326
by: Jeff Thies | last post by:
I have a number of elements of "some-class". I'd like to change the styles of some-class: from ..some-class{color: red; display: block} to
2
2851
by: wjbell | last post by:
I have a piece of javascript I need to modify. Right now it changes a stylesheet in the document between style.css and no_indent.css. These are in the head of my document: <link rel=stylesheet...
5
1956
by: Andrew Poulos | last post by:
If I have an external stylesheet that is @imported into my page and it has an element that looks like this: * html td { font-style: italic; } how can I use javascript to change the font...
3
3607
by: June Moore | last post by:
Hi all, Is there a way to use javascript to change a web page's default layout e.g. change page orientation to landscape or portrait when the user prints a copy of the webpage? Thanks, June..
6
2033
by: tshad | last post by:
Is there a way during Page_Load to change or add an attribute to the Body tag? I want to be able to change the onLoad body attribute to do a focus on one of my text boxes, such as: ...
3
2744
by: fbwhite | last post by:
I am having an issue (maybe two issues) in my application regarding a stylesheet not loading and I am getting Javascript Errors. If I clean out a client's temporary internet files and then browse...
10
1666
by: evanburen | last post by:
I'm trying to text the text inside id="DirectorsCaption" within the hideDirectors() and showDirectors() functions but it's not working. I'm trying different variations using .innerHTML but with no...
8
1677
by: matturn | last post by:
Is it possible to change one of the CSS style attributes of say "ul li"? Not a class or id, but a subset of HTML elements. If so, how would this be done?
1
1663
by: Dave Rado | last post by:
Hi A while ago I discovered a way of creating css pseudo-frames, that offer users the important benefits of real frames (i.e. the navigation remains visible when you scroll down the page), but...
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
4688
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3177
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3168
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1521
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
746
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
399
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.