Hello guys, I am new to this forum and I am here to ask the above question. But first please let me post the code first before I will elaborate my problem further.
First HTML:
[code=html]
<html>
<head>
<title>Testing Summarizer</title>
<link href=”screenCSS.css” rel=”stylesheet” type=”text/css”/>
</head>
<body>
<script language= “javascript” type= “text/javascript”>
var article;
function val_input()
{
article = document.getElementById(‘pasteArticle’).value;
if(article == null || article == “”)
{
alert(“Passage cannot be empty.”);
return false;
}
else
{
var errorMessage = SummarizerApplet.verifyLength(article);
if(errorMessage == “The length of the passage does not meet the minimum requiremet.”)
{
alert(errorMessage);
clearContent();
return false;
}
else
{
alert(errorMessage);
var summmary = new Array();
summmary = SummarizerApplet.startSummarizing(article);
for (i=0; i<summmary.length; i++)
{
document.write(summmary[i]);
}
}
}
}
function clearContent()
{
window.open(“screen.html”, “_self”);
}
</script>
<div id=”wrapper”>
<div id=”content”>
<p style=”text-align: center;font-family: Cursive”>Testing Summarizer</p>
</div>
</div>
<form method=”post” id=”myform” onsubmit=”return val_input()”>
<table align=”center” style=”margin-top: 70px”>
<tr>
<td class=”leftSide”>
<label for=”pasteArticle”>
Article wanted to be</br> summarized:
</label>
</td>
<td class=”rightSide” >
<textarea rows=”19″ cols=”100″ id=”pasteArticle” style=”resize: none” placeholder=”For summarizing an article, please paste your article here.” tabindex=”1″></textarea>
<applet id=”SummarizerApplet” code=”Summarizer.class” width=”0″ height=”0″>
</applet>
</td>
</tr>
<tr>
<td class=”leftSide” >
<label for=”focusThis”>
Output Form:
</label>
</td>
<td class=”rightSide”>
<input type=”radio” name=”outputForm” id =”focusThis” value=”text” tabindex=”2″>Text<br>
<input type=”radio” name=”outputForm” value=”diagram” tabindex=”3″>Diagram
</td>
</tr>
<tr>
<td style=”font-family: Cursive;font-size: 1.2em; padding-top: 18px; padding-left: 40px”>
<label for=”focusThis1″>
Translation Language:
</label>
</td>
<td style=”padding-top: 18px;padding-left:100px”>
<input type=”radio” name=”translationLanguage” id =”focusThis1″ value=”english” tabindex=”4″>English<br>
<input type=”radio” name=”translationLanguage” value=”french” tabindex=”5″>French<br>
</td>
</tr>
<table style=”padding-top: 80px” align=”left”>
<tr>
<td style=”padding-left:470px”>
<input type=”image” src=”button.jpg” align=”middle” alt=”Summarize button” style=”width:153px;height:40px” tabindex=”7″ title=”Click here to summarize an article.”>
</td>
<td style=”padding-left:100px” >
<input type=”image” src=”button(1).jpg” alt=”Cancel button” style=”width:153px;height:40px” tabindex=”8″ title=”Click here to cancel the summarization of an article.” onclick=”clearContent()”>
</td>
</tr>
</table>
</table>
</form>
</body>
</html>
So, from the first HTML file above, inside the script tag, you all can see the below section of code.
[code=html]
else
{
alert(errorMessage);
var summary = new Array();
summary = SummarizerApplet.startSummarizing(article); // SummarizerApplet.startSummarizing(article); will return a String array.
for (i=0; i<summary.length; i++)
{
document.write(summary[i]);
}
}
There is no problem with the code except that all ‘summary[i]‘ will be displayed in a new window that replaces the above HTML file. After this, it can be seen that this function is inside the first HTML file too. So, now my question is there a way to display all the contents of ‘summary’ variable inside the textarea tag within the second HTML?
Second HTML:
[code=html]
<html>
<head>
<title>Testing Summarizer</title>
<link href=”screenCSS.css” rel=”stylesheet” type=”text/css”/>
</head>
<body>
<div id=”wrapper”>
<div id=”content”>
<p style=”text-align: center;font-family: Cursive” tabindex=”1″>Testing Summarizer</p>
</div>
</div>
</body>
<p id=”summary”>Summary:</p>
<p style=”padding-top:0.5em” align=”middle” id=”summaryHere”><textarea rows=”35″ cols=”130″ id=”summary” style=”resize: no” id=”centerTextarea” tabindex=”1″></textarea></p>
<input type=”image” src=”button(2).jpg” alt=”Back button” tabindex=”2″ title=”Click here to go back to the summarizer main page.” id=”back” style=”padding-left:600px”>
</html>
Any help or suggestions will be appreciated.