/    Sign up×
Community /Pin to ProfileBookmark

Hidden Frame & Javascript

Hi all!
I am just a new in scripting and programming and having common problems.
And now I have such problem:
I have an index.htm file with frames:

<html>
<head>
<title>Workshops</title>
</head>
<base target=”_top”>
<frameset rows=”21%,79%,1%” cols=”*” frameborder=”no”>

<frameset rows=”*” cols=”250,*,237″>
<frame src=”logo.htm” name=”logo” scrolling=”no” />
<frame src=”titlepage.htm” name=”title” scrolling=”no”/>
<frame src=”login.htm” name=”login” scrolling=”no”/>
</frameset>

<frameset rows=”*” cols=”178,*,189″>
<frame src=”navigation.htm” name=”navigation” scrolling=”auto”/>
<frame src=”startpage.htm” name=”area” scrolling=”auto”/>
<frame src=”search.htm” name=”search” scrolling=”auto”/>
</frameset>

<frame src=”frame_control.htm” name=”control” scrolling=”no” />
<frame src=”empty.htm” name=”buffer” scrolling=”no”/>

</frameset>
<noframes></noframes>
</html>

the navigation.htm file:

<html>
<head>
<title>Workshops Quick Navigation</title>
<link rel=”stylesheet” type=”text/css” href=”style.css” />
</head>
<body>
<strong>Quick Navigation</strong>
<hr>
<ul id=”workshoplist”><strong>Workshop List:</strong></ul>
<hr>
<a id=”allsessions” href=”javascript:parent.control.allSessions()”>All Sessions</a><br>
<a id=”allteachers” href=”javascript:parent.control.allTeachers()”>All Teachers</a><br>
<a id=”allparticipants” href=”javascript:parent.control.allParticipants()”>All Participants</a>
</body>
</html>

startpage.htm file:

<html>
<head>
<title>Introduction</title>
<link rel=”stylesheet” type=”text/css” href=”style.css” />
</head>
<body>
<p>
<table align=”center”>
<tr>
<td>
<h3 align=”center”>Short Introduction</h3>
<p> blablabla
</p>
</td>
</tr>
</table>
</p>
<p align=”center”>
<table id=”information”>
</table>
</p>
</body>
</html>

the frame_control.htm:

<html>
<head>
<script>
<!–
function allWorkshops()
{
serverLoad(“AllWorkshops”);
extractAllWorkshops();
}
function serverLoad(servlet)
{
var server=”http://localhost:8080/workshop/“;
var url = server + servlet;
parent.frames[“buffer”].document.location.href=url;
}
function extractAllWorkshops()
{
var workshoplist = parent.frames[“buffer”].document.forms[“buffer”].data.value;
var doc = parent.frames[“area”].document;
var table = doc.getElementById(“information”);
var nav = parent.frames[“navigation”].document;
var ul = nav.getElementById(“workshoplist”);
var allrows = new Array();
allrows = workshoplist.split(“^{}^“);
var onerow = new Array();

var headingrow = table.insertRow(0);
var wtitleheader = doc.createElement(“th”);
var wdescheader = doc.createElement(“th”);
var wprereqheader = doc.createElement(“th”);
var wcityheader = doc.createElement(“th”);
var wcountryheader = doc.createElement(“th”);
var wsdateheader = doc.createElement(“th”);
var wedateheader = doc.createElement(“th”);
var pnumberheader = doc.createElement(“th”);

var wtitledata = doc.createTextNode(“Workshop Title”);
var wdescdata = doc.createTextNode(“Description”);
var wprereqdata = doc.createTextNode(“Prerequisits”);
var wcitydata = doc.createTextNode(“City”);
var wcountrydata = doc.createTextNode(“Country”);
var wsdatedata = doc.createTextNode(“Start Date”);
var wedatedata = doc.createTextNode(“End Date”);
var pnumberdata = doc.createTextNode(“Number Of Participants”);

wtitleheader.appendChild(wtitledata);
wdescheader.appendChild(wdescdata);
wprereqheader.appendChild(wprereqdata);
wcityheader.appendChild(wcitydata);
wcountryheader.appendChild(wcountrydata);
wsdateheader.appendChild(wsdatedata);
wedateheader.appendChild(wedatedata);
pnumberheader.appendChild(pnumberdata);

headingrow.appendChild(wtitleheader);
headingrow.appendChild(wdescheader);
headingrow.appendChild(wprereqheader);
headingrow.appendChild(wcityheader);
headingrow.appendChild(wcountryheader);
headingrow.appendChild(wsdateheader);
headingrow.appendChild(wedateheader);
headingrow.appendChild(pnumberheader);
table.appendchild(headingrow);

for(var i=0; i<allrows.length; i++)
{
onerow = allrows[i].split(“^1^”);
var li = nav.createElement(“li”);
var link = nav.createElement(“a”);
var wtitle = link.appendChild(nav.createTextNode(onerow[0]));
link.href = “javascript:parent.control.oneWorkshop(“+onerow[0]+”);”
link.appendChild(wtitle);
li.appendChild(link);
ul.appendChild(li);
var tr = doc.createElement(“tr”);
for(var k=0, k<onerow.length; k++)
{
var td = doc.createElement(“td”);
td.appendChild(doc.createTextNode(onerow[k]);
tr.appendChild(td);
}
table.appendChild(tr);
}
doc.appendChild(table);
nav.appendChild(ul);
}
–>
</script>

</head>
<body onLoad=”allWorkshops()”>
</body>
</html>

and the the servlet works itself fine, since it is generating such code to be written in empty.htm:

the output of [url]http://localhost:8080/workshop/AllWorkshops[/url] with viewing source is as follows:

<html>
<head></head>
<body>
<form name=”buffer”>
<input type=”hidden” name=”data” value=”Web Development ^1^ The Discussion of different issues of Web Development Technologies, Web Applications, Web Services, Server & Client Side scripting, Most new technologies ^1^ Knowledge of Javascript, At least one server side technology language, and Markup Languages. Also knowledge one or more programming languages (Better Java) ^1^ Graz ^1^ Austria ^1^ 2006-05-20 ^1^ 2006-06-18 ^1^ 2 ^{}^ Developing Countries ^1^ The discussion of common problems of developing countries and the ways of solving them, discussing almost every countries’ case and finding the ways to solve problems ^1^ Knowledge of International Economics, International Law & the power of understanding and thinking about politics ^1^ Wien ^1^ Austria ^1^ 2006-05-19 ^1^ 2006-06-15 ^1^ 2 ^{}^ “>
</form>
</body>
</html>

But when I open the [url]http://localhost:8080/workshop/index.htm[/url] this dynamic information is not displayed. just only the fixed content that I have defined in html.

Can anyone help me? or tell me what kind of mistake do I have?

Regards

jege

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @jege spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...