Javascript + CSS? (edited)

Odoacer

Senior member
Jun 30, 2001
809
0
0
complete re-edit:

okay well i've got a javascript random background chooser and i need to set the background using CSS styles.


My CSS code is nothing special:
body {background:ffffff url(JAVASCRIPT HERE) no-repeat fixed right top }


ok i simply made a javascript function (showImage) that prints out the name of the selected picture. I can't figure out how to implement it in CSS - url(showImage()) doesnt work... because <script> and <style> tags dont seem to work nested inside each other... help?
 

Buddha Bart

Diamond Member
Oct 11, 1999
3,064
0
0
sorry, you can't embed javascript in a style sheet. You may find a browser that lets you get away with it, but its completely out of spec.

Do you have any server-side tools at your disposal? PHP, Perl, ASP, ColdFusion, etc?

bart
 

Odoacer

Senior member
Jun 30, 2001
809
0
0
yes, perl and PHP

got any scripts for either i can use?

i dont know how to code either one of them... although i've heard of using C++ (which i know) in .cgi files in place of perl