Dragonfish
Programmer
The following scenorio:
On this WebSite a button is pushed to call a JavaScript-function which writes a (style-sheet-formatted) text. This code is in the HTML document (note the rollover-function and the class="style_button_eins" which positions the button work - except with Netscape):
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>hauptfenster</title>
<link rel=stylesheet type="text/css" href="textstyle.css">
<meta name="author" content="gullever">
<meta name="generator" content="Ulli Meybohms HTML EDITOR">
<script language="JavaScript" src="steuern.js" type="text/javascript"></script>
</head>
<body text="#FF0000" bgcolor=#C0C0C0 link="#FF0000" alink="#FF0000" vlink="#FF0000">
<FORM>
<input type="image"
src="button1-1.gif"
name="Image1"
class="style_button_eins"
onclick="button('Herren_eins')"
onMouseOver="MM_swapImage('Image1','','button1-2.gif',1)"
onMouseOut="MM_swapImgRestore()">
<input type="image"
src="button1-1.gif"
name="Image11"
class="style_button_elf"
onclick="button('Update')"
onMouseOver="MM_swapImage('Image11','','button1-2.gif',1)"
onMouseOut="MM_swapImgRestore()">
</FORM>
</body>
</html>
When the JavaScript-funtion calls an alert as in case "Herren_eins" it is sucessful. When the JavaScript-funtion calls "Update" then the text - This is a Test - is writen but not formatted with class='style_Mannschaften'.
*** External JavaScript ***
function button(buttonName)
{
switch (buttonName)
{
case "Herren_eins": alert(buttonName);
Break;
case "Update": Update();
Break;
default: alert("does´t work!"
}
}
function Update()
{
document.write("<p class='style_Mannschaften'>This is a Test</p>"
}
*** External CSS ***
The CSS line looks like this:
.style_Mannschaften { border: none; position: absolute; top: 100px; left: 570px; width: 250pt; }
If I simply write This is a Test in the HTML document using the style sheet then it works
So my problem is how to integrate CSS into Javascript. Other HTML tags - as we all Know - work in JavaScript. Later when this works I´d like to know how to integrate PHP-statements into JavaScript to access a MySQL Database but I have´nt found any interdeciplinary literature in WWW. Can anybody help.
Thanks - David in Germany
On this WebSite a button is pushed to call a JavaScript-function which writes a (style-sheet-formatted) text. This code is in the HTML document (note the rollover-function and the class="style_button_eins" which positions the button work - except with Netscape):
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>hauptfenster</title>
<link rel=stylesheet type="text/css" href="textstyle.css">
<meta name="author" content="gullever">
<meta name="generator" content="Ulli Meybohms HTML EDITOR">
<script language="JavaScript" src="steuern.js" type="text/javascript"></script>
</head>
<body text="#FF0000" bgcolor=#C0C0C0 link="#FF0000" alink="#FF0000" vlink="#FF0000">
<FORM>
<input type="image"
src="button1-1.gif"
name="Image1"
class="style_button_eins"
onclick="button('Herren_eins')"
onMouseOver="MM_swapImage('Image1','','button1-2.gif',1)"
onMouseOut="MM_swapImgRestore()">
<input type="image"
src="button1-1.gif"
name="Image11"
class="style_button_elf"
onclick="button('Update')"
onMouseOver="MM_swapImage('Image11','','button1-2.gif',1)"
onMouseOut="MM_swapImgRestore()">
</FORM>
</body>
</html>
When the JavaScript-funtion calls an alert as in case "Herren_eins" it is sucessful. When the JavaScript-funtion calls "Update" then the text - This is a Test - is writen but not formatted with class='style_Mannschaften'.
*** External JavaScript ***
function button(buttonName)
{
switch (buttonName)
{
case "Herren_eins": alert(buttonName);
Break;
case "Update": Update();
Break;
default: alert("does´t work!"
}
}
function Update()
{
document.write("<p class='style_Mannschaften'>This is a Test</p>"
}
*** External CSS ***
The CSS line looks like this:
.style_Mannschaften { border: none; position: absolute; top: 100px; left: 570px; width: 250pt; }
If I simply write This is a Test in the HTML document using the style sheet then it works
So my problem is how to integrate CSS into Javascript. Other HTML tags - as we all Know - work in JavaScript. Later when this works I´d like to know how to integrate PHP-statements into JavaScript to access a MySQL Database but I have´nt found any interdeciplinary literature in WWW. Can anybody help.
Thanks - David in Germany