Reply
hiding css source code
Old 02-17-2008, 11:09 AM hiding css source code
Junior Talker

Posts: 2
Name: Tiffany
I don't normally care about hiding source code but I have a client that I want to show how their website will look and I don't want to give away the code...so being new at this I thought that I could create the css file on the fly and after the html has been output then write over the css file. It sounds good but isn't working. Is there some fundamental thing about css files and html pages that I am missing???
tiffbrink is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 02-17-2008, 02:24 PM Re: hiding css source code
xkaosx's Avatar
Experienced Talker

Posts: 31
Name: Junior
Location: East LA
just get the style of the website and make a new .CSS and put the code then in your HTML template/website include the css file.
__________________
http://buxlegend.com/
Great new Bux site!
xkaosx is offline
Reply With Quote
View Public Profile Visit xkaosx's homepage!
 
Old 02-17-2008, 02:24 PM Re: hiding css source code
chrishirst's Avatar
Super Moderator

Posts: 11,885
Location: Blackpool. UK
A bit of DOM scripting to the rescue

HTML Code:
<script type="text/javascript" src="css.js"></script>
css.js
HTML Code:
var cssFile = document.createElement('link');
cssFile.type = 'text/css';
cssFile.rel = 'stylesheet';
cssFile.href = '/test.css';
cssFile.media = 'screen';
cssFile.title = 'dynamicLoadedSheet';
document.getElementsByTagName("head")[0].appendChild(cssFile); 
set the name of the stylesheet to suit. Maybe change the name of the js file as well.
It won't stop anybody who is determined to steal the design but it will stop the casual onlooker.
Or you could DOM script the entire style sheet though that would take a lot of work.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-17-2008, 03:21 PM Re: hiding css source code
Average Talker

Posts: 20
continuing what xkaosx said, you could take the style, and then put it in a file called "style.css", continuing on and putting it in a URL which has hotlink protection enabled (via .htaccess) and then adding in the following code where the <style type> should be.
Quote:
<link rel="stylesheet" type="text/css" href="http://www.yoursite.com/style.css" />
__________________
MyPaidHost.com - Cheap Webhosting, Reliable Host, Convenient Setup and Friendly Customer Service.
http://www.mypaidhost.com/

Last edited by mypaidhost : 02-17-2008 at 03:21 PM. Reason: Typo
mypaidhost is offline
Reply With Quote
View Public Profile
 
Old 02-17-2008, 04:30 PM Re: hiding css source code
Webmaster Talker

Posts: 623
Location: Kokkola, Finland
how about just showing them a screenshot??
davemies is online now
Reply With Quote
View Public Profile Visit davemies's homepage!
 
Old 02-18-2008, 06:56 AM Re: hiding css source code
Tixylix's Avatar
Super Talker

Posts: 105
Name: Steve
Location: Australia
LOL!

Anyway, not sure why you'd want to do this, but I would have suggested the non hot-linking option, much easier if you have cPanel too, no matter how much some people hate it.
__________________
There's more to be discovered...
SHolland Network
Tixylix is offline
Reply With Quote
View Public Profile Visit Tixylix's homepage!
 
Old 03-03-2008, 01:29 PM Re: hiding css source code
Junior Talker

Posts: 2
Name: Tiffany
Thanks for the suggestions. I ended up getting what I was doing to work but it was much more work than what was suggested here so I think I will try a couple of your methods before I even think about using my method again.
tiffbrink is offline
Reply With Quote
View Public Profile
 
Old 03-06-2008, 04:33 PM Re: hiding css source code
Novice Talker

Posts: 6
a full sized screen shot is the best way to show what a would page look like. It's always good to have your own "intranet" if you wanna show functionabilities of what you can do to customers. (like create a fake teacher/course/classroom manager with reports, add/edit/delete, etc.. and let them play with it.)
iliketocode is offline
Reply With Quote
View Public Profile
 
Old 03-06-2008, 04:40 PM Re: hiding css source code
Webmaster Talker

Posts: 623
Location: Kokkola, Finland
if you're going to actually visit your client then take a local copy of the site on a laptop so they can see. if not then a screen shot should do
davemies is online now
Reply With Quote
View Public Profile Visit davemies's homepage!
 
Reply     « Reply to hiding css source code
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.15320 seconds with 13 queries