Changing css document without reloading page

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Changing css document without reloading page

Post by Luke »

I am trying to make a "print this page" button on my invoices in MIVA merchant... I need to be able to change the css document without reloading the page, because reloading the page kills the session. Is this possible?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You can specify a separate CSS file that is just for printing.

http://www.w3.org/TR/REC-CSS2/media.html
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

I don't understand... is this what you do?

Code: Select all

<style type="text/css">
<!--
@import url(../css/master.css);
@import url(../css/printmaster.css) print;
-->
</style>
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Link tags are what I use.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

Holy smurf!! That's awesome. Works great!! Thanks man
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

Not a real big deal, but in Opera, the body background still shows up even if i change it or make it not have a background in the print css file. If anybody knows why... let me know. THX
Post Reply