Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Apr 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Saving a stylesheet with javascript

    Hi folks,
    I am making a very configurable site right down to a floating object that a user can drag anywhere. What I'd like to do is have an option for users to "save" their site changes, probably with a cookie or using their IP. The site is similar to my.yahoo.com but is more focused. I want users to be able to change things like the color scheme, and the location of some objects, which I can handle, and then "save" those particular settings for when they come back.

    I've figured out that I can do everything in a CSS so what I need is for a user to "save" the current stylesheet. I could put everything inline but the problem is, when a user changes the location of an object, it doesn't change the stylesheet or source code. I'd like it to do that if possible.

    Anyone have any ideas?

    Thanks in advance for your help.

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    The cookie is limited to the amount of info it can hold. You really need to use a server side langauge to hold the changes. That is how the big sites do it so you can log in anywhere and get your personal defaults.

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #3
    New to the CF scene
    Join Date
    Apr 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Good point. Plus I anticipate a lot of my visitors to have dynamic IPs like Universities, etc. Do you (or anyone else) have any suggestions for the server-side code?

    Thanks for the timely response!

    Cyrus

  • #4
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    What does your server support...that is where you need to start...

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #5
    New to the CF scene
    Join Date
    Apr 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I believe it supports most major scripts including PERL, PHP, MySQL is definately supported.

    I just realized that if I can find a membership script that sets which stylesheet to use based on either a cookie or IP, I would be 1/2 way to my goal. I would then only need to figure out how to allow a user's modifications to create a new stylesheet.

    I realize this would take up a lot of space as more users came, but I think it would be worth it.

    If you go to http://www.cyruspatten.com/test.html You can see a rough idea of what I'm trying to do. The floating box can be moved by the user, and I want it to be in the place the user moves it to the next time they visit. Later I will incorporate a million other features.

    Cyrus
    Last edited by visiondemocracy; 04-13-2005 at 08:28 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •