Click to See Complete Forum and Search --> : uhhh...whats wrong with this?
xataku_nakusute
07-24-2003, 08:52 PM
<script type="text/javascript">
function viewpage()
{
html = window.open();
t = document.hedit.t.value;
h = document.hedit.h.value;
bgc = document.hedit.bgc.value;
bgi = document.hedit.bgi.value;
hs = document.hedit.hs.value;
hc = document.hedit.hc.value;
hf = document.hedit.hf.value;
ha = document.hedit.ha.value;
ht = document.hedit.ht.value;
imgs = document.hedit.imgs.value;
imgw = document.hedit.imgw.value;
imgh = document.hedit.imgh.value;
imga = document.hedit.imga.value;
ts = document.hedit.ts.value;
tc = document.hedit.tc.value;
tf = document.hedit.tf.value;
ta = document.hedit.ta.value;
tt = document.hedit.tt.value;
l1 = document.hedit.l1.value;
l1url = document.hedit.l1url.value;
l1c = document.hedit.l1c.value;
l1td = document.hedit.l1td.value;
l2 = document.hedit.l2.value;
l2url = document.hedit.l2url.value;
l2c = document.hedit.l2c.value;
l2td = document.hedit.l2td.value;
l3 = document.hedit.l3.value;
l3url = document.hedit.l3url.value;
l3c = document.hedit.l3c.value;
l3td = document.hedit.l3td.value;
html.document.write("<html>"+"<head>"+"<title>"+t+"</title>"+h+"</head>"+"<body bgcolor="+bgc+" style='background: url("+bgi+");'>"+\
"<h"+hs+"style='color: "+hc+"; font-family: "+hf+"; text-align: "+ha+";'>"+ht+"</h"+hs+">"+"<p>"+\
"<img src='+imgs+"' width="+imgw+" height="+imgh+" alt='"+imga"'>"+"<p><p><p><p><p>"+\
"<div style='font-size: "+ts+"; color: "+tc+"; font-family: "+tf+"; text-align: "+ta+";'>"+tt+"</div>"+"<p>"+\
"<a href='"+l1url+"' style='color: "+l1c+"; text-decoration: "+l1td+";'>"+l1+"</a>"+"<br>"+\
"<a href='"+l2url+"' style='color: "+l2c+"; text-decoration: "+l2td+";'>"+l2+"</a>"+"<br>"+\
"<a href='"+l3url+"' style='color: "+l3c+"; text-decoration: "+l3td+";'>"+l3+"</a>"+"<br>"+\
"</body>"+"</html>");
}
</script>
AdamBrill
07-24-2003, 09:09 PM
It's probably on these lines:html.document.write("<html>"+"<head>"+"<title>"+t+"</title>"+h+"</head>"+"<body bgcolor="+bgc+" style='background: url("+bgi+");'>"+\
"<h"+hs+"style='color: "+hc+"; font-family: "+hf+"; text-align: "+ha+";'>"+ht+"</h"+hs+">"+"<p>"+\
"<img src='+imgs+"' width="+imgw+" height="+imgh+" alt='"+imga"'>"+"<p><p><p><p><p>"+\
"<div style='font-size: "+ts+"; color: "+tc+"; font-family: "+tf+"; text-align: "+ta+";'>"+tt+"</div>"+"<p>"+\
"<a href='"+l1url+"' style='color: "+l1c+"; text-decoration: "+l1td+";'>"+l1+"</a>"+"<br>"+\
"<a href='"+l2url+"' style='color: "+l2c+"; text-decoration: "+l2td+";'>"+l2+"</a>"+"<br>"+\
"<a href='"+l3url+"' style='color: "+l3c+"; text-decoration: "+l3td+";'>"+l3+"</a>"+"<br>"+\
"</body>"+"</html>"); Take out all of the slashes on the end of each line....
xataku_nakusute
07-25-2003, 12:01 AM
<html>
<head>
<style>
a:
{
cursor: default;
color: #696969;
text-decoration: underline;
filter: alpha(Opacity=67);
}
a:visited
{
cursor: default;
color: #696969;
text-decoration: underline;
filter: alpha(Opacity=67);
}
a:hover
{
cursor: default;
color: #c0c0c0;
text-decoration: none;
filter: alpha(Opacity=67);
}
body
{
scrollbar-face-color: #ffffff;
scrollbar-arrow-color: #404060;
scrollbar-highlight-color: #404060;
scrollbar-3dhighlight-color: #ffffff;
scrollbar-darkshadow-color: #ffffff;
scrollbar-shadow-color: #404060;
scrollbar-track-color: #ffffff;
font-family: arial, tahoma;
font-size: 9pt;
color: #404060;
}
input
{
border-style: solid;
border-width: 1px;
border-color: #404060;
filter: alpha(Opacity=67);
font-family: arial, tahoma;
font-size: 9pt;
color: #404060;
}
.i
{
border-style: solid;
border-width: 1px;
border-color: #404060;
filter: alpha(Opacity=67);
font-family: arial, tahoma;
font-size: 9pt;
color: #404060;
}
.i1
{
border-style: solid;
border-width: 1px;
border-color: #ffffff;
background: #404060;
filter: alpha(Opacity=67);
font-family: arial, tahoma;
font-size: 9pt;
color: #ffffff;
}
table
{
background: #ffffff;
border-style: solid;
border-width: 1px;
border-color: #404060;
width: auto;
height: auto;
filter: alpha(Opacity=100);
}
table.menu
{
background: transparent;
border-style: solid;
border-width: 0px;
}
td.1
{
background: #ffffff;
border-style: solid;
border-width: 1px;
border-color: #ffffff;
width: auto;
height: auto;
filter: alpha(Opacity=100);
font-family: arial, tahoma;
font-size: 9pt;
color: #404060;
}
.2
{
border-style: solid;
border-width: 1px;
border-color: #404060;
width: auto;
height: auto;
filter: alpha(Opacity=67);
font-family: arial, tahoma;
font-size: 9pt;
color: #404060;
}
td.3
{
background: #ffffff;
border-style: solid;
border-width: 1px;
border-color: #404060;
width: auto;
height: auto;
filter: alpha(Opacity=100);
font-family: arial, tahoma;
font-size: 9pt;
color: #404060;
}
.4
{
border-style: solid;
border-width: 1px;
border-color: #404060;
width: auto;
height: auto;
filter: alpha(Opacity=37);
font-family: arial, tahoma;
font-size: 9pt;
color: #ffffff;
background: #404060;
}
</style>
<script type="text/javascript">
function viewpage()
{
t = document.hedit.t.value;
h = document.hedit.h.value;
bgc = document.hedit.bgc.value;
bgi = document.hedit.bgi.value;
hs = document.hedit.hs.value;
hc = document.hedit.hc.value;
hf = document.hedit.hf.value;
ha = document.hedit.ha.value;
ht = document.hedit.ht.value;
imgs = document.hedit.imgs.value;
imgw = document.hedit.imgw.value;
imgh = document.hedit.imgh.value;
imga = document.hedit.imga.value;
ts = document.hedit.ts.value;
tc = document.hedit.tc.value;
tf = document.hedit.tf.value;
ta = document.hedit.ta.value;
tt = document.hedit.tt.value;
l1 = document.hedit.l1.value;
l1url = document.hedit.l1url.value;
l1c = document.hedit.l1c.value;
l1td = document.hedit.l1td.value;
l2 = document.hedit.l2.value;
l2url = document.hedit.l2url.value;
l2c = document.hedit.l2c.value;
l2td = document.hedit.l2td.value;
l3 = document.hedit.l3.value;
l3url = document.hedit.l3url.value;
l3c = document.hedit.l3c.value;
l3td = document.hedit.l3td.value;
window.open().document.write("<html>"+"<head>"+"<title>"+t+"</title>"+h+"</head>"+"<body bgcolor="+bgc+" style='background: url("+bgi+");'>"+"<h"+hs+"style='color: "+hc+"; font-family: "+hf+"; text-align: "+ha+";'>"+ht+"</h"+hs+">"+"<p>"+"<img src='+imgs+"' width="+imgw+" height="+imgh+" alt='"+imga"'>"+"<p><p><p><p><p>"+"<div style='font-size: "+ts+"; color: "+tc+"; font-family: "+tf+"; text-align: "+ta+";'>"+tt+"</div>"+"<p>"+"<a href='"+l1url+"' style='color: "+l1c+"; text-decoration: "+l1td+";'>"+l1+"</a>"+"<br>"+"<a href='"+l2url+"' style='color: "+l2c+"; text-decoration: "+l2td+";'>"+l2+"</a>"+"<br>"+"<a href='"+l3url+"' style='color: "+l3c+"; text-decoration: "+l3td+";'>"+l3+"</a>"+"<br>"+"</body>"+"</html>");
}
</script>
</head>
<body>
<center><div class="i"><h1>Basic Editor</h1></div></center>
<br>
Follow all of the directions given:
<p>
<br>
<p>
<form name="hedit">
Insert title name(this will appear at the very top in the blue section of the browser):
<input type="text" name="t"><p>
Insert head scripts(script, style, etc...) *This may be left blank*:
<input type="text" name="h"><p>
Insert the page's background color(leaving this field blank will use your browser's default bgcolor; usually white):
<input type="text" name="bgc"><p>
Insert the page's background image *This may be left blank*:
<input type="text" name="bgi"><p>
Insert size of the page header(1-6 only):
<input type="text" name="hs"><p>
Insert color of the page header(hex value or name):
<input type="text" name="hc"><p>
Insert font name of the page header(case-sensitive):
<input type="text" name="hf"><p>
Insert alignment of the page header(left, center, right):
<input type="text" name="ha"><p>
Insert what the page header will say:
<input type="text" name="ht"><p>
Insert size of the page text(specify whether in pixels:"px", font-point:"pt", centimeters:"cm", etc...):
<input type="text" name="ts"><p>
Insert color of the page text(hex value or name):
<input type="text" name="tc"><p>
Insert font name of the page text(case-sensitive):
<input type="text" name="tf"><p>
Insert alignment of the page text(left, center, right):
<input type="text" name="ta"><p>
Insert what the page text will say(you may use simple tags within such as <font> tags and <br>/<p> tags as well):<br>
<center><textarea cols="100" rows="10" name="tt"></textarea></center><p>
Insert the URL of your 1st link(include "http://"):
<input type="text" name="l1url"><p>
Insert the color of your 1st link(hex value or name):
<input type="text" name="l1c"><p>
Insert the text-decoration of your 1st link(underline, linethrough, overline; to choose mutliple, just leave a space between each one):
<input type="text" name="l1td"><p>
Insert what your 1st link will say:
<input type="text" name="l1"><p>
Insert the URL of your 2nd link(include "http://"):
<input type="text" name="l2url"><p>
Insert the color of your 2nd link(hex value or name):
<input type="text" name="l2c"><p>
Insert the text-decoration of your 2nd link(underline, linethrough, overline; to choose mutliple, just leave a space between each one):
<input type="text" name="l2td"><p>
Insert what your 2nd link will say:
<input type="text" name="l2"><p>
Insert the URL of your 3rd link(include "http://"):
<input type="text" name="l3url">
Insert the color of your 3rd link(hex value or name):
<input type="text" name="l3c"><p>
Insert the text-decoration of your 3rd link(underline, linethrough, overline; to choose mutliple, just leave a space between each one):
<input type="text" name="l3td"><p>
Insert what your 3rd link will say:
<input type="text" name="l3"><p>
<input type="button" value="Generate Page" onclick="viewpage()">
</form>
</body>
</html>
AdamBrill
07-25-2003, 07:24 AM
Ok, the only part that I changed anything in is in the script, so I'll only give you that part. ;)<script type="text/javascript">
function viewpage()
{
t = document.hedit.t.value;
h = document.hedit.h.value;
bgc = document.hedit.bgc.value;
bgi = document.hedit.bgi.value;
hs = document.hedit.hs.value;
hc = document.hedit.hc.value;
hf = document.hedit.hf.value;
ha = document.hedit.ha.value;
ht = document.hedit.ht.value;
imgs = document.hedit.imgs.value; //doesn't exist, but needed in the window.open().document.write() line
imgw = document.hedit.imgw.value; //doesn't exist, but needed in the window.open().document.write() line
imgh = document.hedit.imgh.value; //doesn't exist, but needed in the window.open().document.write() line
imga = document.hedit.imga.value; //doesn't exist, but needed in the window.open().document.write() line
ts = document.hedit.ts.value;
tc = document.hedit.tc.value;
tf = document.hedit.tf.value;
ta = document.hedit.ta.value;
tt = document.hedit.tt.value;
l1 = document.hedit.l1.value;
l1url = document.hedit.l1url.value;
l1c = document.hedit.l1c.value;
l1td = document.hedit.l1td.value;
l2 = document.hedit.l2.value;
l2url = document.hedit.l2url.value;
l2c = document.hedit.l2c.value;
l2td = document.hedit.l2td.value;
l3 = document.hedit.l3.value;
l3url = document.hedit.l3url.value;
l3c = document.hedit.l3c.value;
l3td = document.hedit.l3td.value;
window.open().document.write("<html>"+"<head>"+"<title>"+t+
"</title>"+h+"</head>"+"<body bgcolor="+bgc+" style='background: url("+bgi+");'>"+
"<h"+hs+"style='color: "+hc+"; font-family: "+hf+"; text-align: "+ha+";'>"+ht+"</h"+hs+">"+
"<p>"+"<img src='"+imgs+"' width="+imgw+" height="+imgh+" alt='"+imga+"'>"+"<p><p><p><p><p>"+
"<div style='font-size: "+ts+"; color: "+tc+"; font-family: "+tf+"; text-align: "+ta+";'>"+
tt+"</div>"+"<p>"+"<a href='"+l1url+"' style='color: "+l1c+"; text-decoration: "+l1td+";'>"+
l1+"</a>"+"<br>"+"<a href='"+l2url+"' style='color: "+l2c+"; text-decoration: "+l2td+";'>"+l2
+"</a>"+"<br>"+"<a href='"+l3url+"' style='color: "+l3c+"; text-decoration: "+l3td+";'>"+l3+
"</a>"+"<br>"+"</body>"+"</html>");
}
</script> Also, when you try to generate it, there will still be errors. That is because you didn't name the form fields right. You will notice on a few lines above in the script I put a comment after some of the lines saying that they don't exist. Those form element don't exist. I wasn't sure what they were supposed to be, so I figured I would let you try. ;) Let me know if you can't get it.....