sujagr8 0 Newbie Poster

I don't know how to be more clear. Have you read and understood the answers you've already been given?

1. The document.write() method is out-of-date. However, if you're using an older DOCTYPE, it should still work for you.

2. That being the case, you can author an entire page using document.write() , so you can place HTML, scripts, event handlers, whatever you like, on that page, just as you would any other page.

3. The code you show uses a plus sign to concatenate strings, for some reason. It isn't necessary, but as you've shown it, there would be no space between "javascript" and "src=". You need to add a space before "src".

4. The document.write() method doesn't "call" anything. It writes a page. That page will need to have the code necessary to call a function... which is the same for any page.

5. If you plan on using document.write() , you'll need a corresponding document.close() .

My questions to you would be:

1. Why are you using document.write() ? If you know enough to write the code into your new window, chances are you know enough to simply author that page offline, and refer to it by URL in your window.open() call.

2. Could you include the javascript in your main page, and have it act on your child window through DOM methods?

Also, please refrain from coloring or formatting your posts. We like to reserve formatting for code only.

Thanks a lot for your response.I got the …

sujagr8 0 Newbie Poster

hi
how to call a function inside script in document.write.
For example.
document.write('<'+'script type="text/javascript"' + 'src="jsr.js"><'+ '/script>');

In this jsr.js file i need to call one function how can i call using document.write method

sujagr8 0 Newbie Poster

hi
I used this code to open new window newwindow2=window.open(' ','popup','scrollbars=1,height=800,width=800'); In that window itself i need script.
Is this scripting is correct or not document.write('<'+'script type="text/javascript"' + 'src="jsr_class.js"><'+ '/script>'); Please reply soon

sujagr8 0 Newbie Poster

how to include javascript in new window using window.open code

sujagr8 0 Newbie Poster

plssssssssss anybody reply me

sujagr8 0 Newbie Poster

hi everybody,
i need to link this html pages if i click submit button.It should fetch the textbox value to another html page

<html>
<head>
</head>
<body>
<form method=post action="g1.html">
<input type=text id="q" >
<input type="submit" name="submit">
</form>
</body>
</html>


<html>
<head>
</head>
<body>
<form method=post>
<input type=text id="q" value="">
<input type=submit name=submit value=Submit>
</form>
</html>

sujagr8 0 Newbie Poster

dear All,
Anyone know about OpenFTS(Full Text Search) engine.
we want to integrate the concept with our own website.
please reply soon...

sujagr8 0 Newbie Poster

Plz let me know the response

sujagr8 0 Newbie Poster

Would need to see the full code in the context of the page to determine what is meant to be happening and why it is not working. Do you have a link to a page we can view?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title></title>
<script type="text/javascript">
function displayHTML()
{
var tablestring='';
var lnstr=document.forms[0].t2.length;
var vrows=1.5;
var vroundrows=1.25;
var vprintstr='';
var inf = document.forms[0].t1.value;
var vt2 = document.forms[0].t2.value;
var vlabels = document.forms[0].tn.value;
alert("opening!!!!!!");
var vofvalue = document.getElementById("fname").options[(document.getElementById("fname").selectedIndex)].value;
alert("opening2!!!!!!!!");
var vofsize=document.getElementById("fsize").options[(document.getElementById("fsize").selectedIndex)].value;
var vlbl=document.forms[0].lsize.selectedIndex;
var textsize=document.forms[0].lsize.options[vlbl].value;

if(inf.length>30)
{
alert ("line 1 should not exceed 30 characters")
t1.value="";
t1.focus();
return;
}
if(vt2.length>30)
{
alert ("line 2 should not exceed 30 characters")
t2.value="";
t2.focus();
return;
}
vprintstr='<a href="javascript:window.print()">Print</a> - <a href="javascript:window.close()">Close Window</a><br><br>'
document.write(vprintstr);
alert("working");
tablestr='<table border="1" cellspacing=10><font face="'+vofvalue+'" size='+vofsize+'>';
for (var x = 1; x <= vlabels; x++)
{
//tablestr=tablestr+'<tr>'+ inf +'</tr><tr>'+ vt2+'</tr>'
tablestr=tablestr+'<table width="310" height="10" align="centre"><font face="'+vofvalue+'" size='+vofsize+'><tr>'+ inf +'</tr></font></table><table width="310" height="60" ><font face="'+vofvalue+'" size='+vofsize+'><tr>'+ vt2+'</tr></font></table></tr>';
}
alert("wo1");
tablest=tablestr +'</font></table>';
alert("wo2");
document.write(tablest);
alert("wo3");
}
</script>
</head>
<body bgcolor="#cfcc3b" LEFTMARGIN=40 TOPMARGIN=5>
<br><br>
<table bgcolor="#201d5b" cellspacing=5 width="900" height="10" >
<tr><td width=20 height="10"></td><td align=center><font color="#ffffff" size=7></font></td></tr>
</table>
<table bgcolor="#201d5b" cellspacing=5 width="900" height="360" …

sujagr8 0 Newbie Poster

thanks a lot for your response.I have changed the code as

<select name="fon" id="fname">
<option value="Arial">Arial</option>
<option value="Symbol">Symbol</option>
<option value="Rockwell">Rockwell</option>

var vofvalue = document.getElementById("fname").options[(document.getElementById("fname").selectedIndex)].value;


<font face="'+vofvalue+'" size='+vofsize+'>


Still not working

sujagr8 0 Newbie Poster

var vvalue=document.forms[0].fname.selectedIndex;
var vovalue=document.forms[0].fname.options[vvalue].value

<select name="fname">
<option value="Arial">Arial</option>
<option value="Symbol">Symbol</option>
<option value="Rockwell">Rockwell</option>

sujagr8 0 Newbie Poster

The code you have posted refences form fields and variables that do not exist in the code you posted. For us, the code can never work. If you want us to help you track down the problem you will need to provide the full content of the page in question, or a link to it.

thanks a lot for your response. i got the result

sujagr8 0 Newbie Poster

Firefox has a built in JavaScript console. Use it to see where the error is. It will tell you what line is causing the error and what kind of error it is.

That code looks very old, too. Not a big surprise it doesn't work in Firefox.

hi
Thank a lot for your quick response.In mozilla new window is not at all opening

sujagr8 0 Newbie Poster

my coding is working well in IE not in mozillafirefox


<html>
<head>
<title></title>
<script LANGUAGE="JavaScript">
function displayHTML(printContent, text2,textn)
{
var inf = printContent;
var vt2=text2
var vlabels=textn
var tablestring=''
var lnstr=text2.length;
var vrows=1.5
var vroundrows=1.25
var vprintstr=''

var vvalue=document.forms[1].fname.selectedIndex;
var vovalue=document.forms[1].fname.options[vvalue].value
var vfsize=document.forms[2].fsize.selectedIndex;
var vofsize=document.forms[2].fsize.options[vfsize].value
var vlbl=document.forms[0].lsize.selectedIndex;
var textsize=document.forms[0].lsize.options[vlbl].value

if(inf.length>30)
{
alert ("line 1 can not exceed 30 characters")
t1.value="";
t1.focus();
return;
}
if(vt2.length>30)
{
alert ("line 2 can not exceed 30 characters")
t2.value="";
t2.focus();
return;
}

win = window.open("print.html", 'popup', 'toolbar = no, status = no');

vprintstr='<a href="javascript:window.print()">Print</a> - <a href="javascript:window.close()">Close Window</a><br><br>'
win.document.write(vprintstr);

if(textsize==1)
{
vrows=vlabels/2;
}
if(textsize==2)
{
vrows=vlabels/3;
}

tablestr='<table border="1" cellspacing=10>'
for (var x = 1; x <= vrows; x++)
{
tablestr=tablestr+'<tr>'

if(textsize==1)
{
tablestr=tablestr+'<td><table width="310" height="94"><font face="'+vovalue+'" size='+vofsize+'><tr>'+ inf +'</tr><tr>'+ vt2+'</tr></table></td>'
tablestr=tablestr+'<td><table width="310" height="94"><font face="'+vovalue+'" size='+vofsize+'><tr>'+ inf +'</tr><tr>'+ vt2+'</tr></table></td>'
}
if(textsize==2)
{
tablestr=tablestr+'<td><table width="184" height="54"><font face="'+vovalue+'" size='+vofsize+'><tr>'+ inf+'</tr><tr>'+ vt2+'</tr></table></td>'
tablestr=tablestr+'<td><table width="184"height="54"><font face="'+vovalue+'" size='+vofsize+'><tr>'+ inf +'</tr><tr>'+ vt2+'</tr></table></td>'
tablestr=tablestr+'<td><table width="184"height="54"><font face="'+vovalue+'" size='+vofsize+'><tr>'+ inf +'</tr><tr>'+ vt2+'</tr></table></td>'
}
tablestr=tablestr+'</tr>'
}
tablestr=tablestr+'</table>'
win.document.write(tablestr);

}
</script>
</head>
<body bgcolor="#cfcc3b" LEFTMARGIN=40 TOPMARGIN=5>
<br><br>
<table bgcolor="#201d5b" cellspacing=5 width="900" height="10" >