Random wrote:
Sergio del Amo wrote:
Hi,
I wrote some functionality for a Web Page with Javascript. My code works
perfectly for Firefox but not for IE.
I become some errors apparently all based in the same problem wich
scapes to my knowledge. If anyone can help me, i would be really grateful.
These are the errors i was speaking about:
...
Can you post your frameset + frames to a website where we may view the
code in its entirety?
My site it is still not online but i post here the code. It is a remote
scripting with hidden frame project. All the javascript is in the
frames_control.htm frame:
frameset:
---------------------------------------------------------
<base target="_top">
<frameset rows="100%,0%,0%" border="0">
<frame src="blog.html" name="blog" scrolling="yes"/>
<frame src="frame_control.htm" name="control" scrolling="no"/>
<frame src="empty.htm" name="Buffer" scrolling="no"/>
</frameset>
-----------------------------------------------------------
blog.html:
-----------------------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="style/style.css" />
<script src="scripts/functions.js" type="text/javascript"></script>
</head>
<body>
<div id="container">
<img id="clip" src="./images/letter_top.gif" />
<div id="primarynav">
<ul>
<li><a href="index.html">Home</a></li>
<li><a
href='javascript
:parent.frames["control"].show_archives()'>Archives</a></li>
<li><a
href='javascript
:parent.frames["control"].show_links()'>Links</a></li>
</ul>
</div>
<div id="decoration">
<img src="images/home_blog.jpg" width="250" height="310px"
alt="AMO BLOG"/>
</div>
<div id="secondarynav">
<h3>Past entries</h3>
</div>
<div id="content">
</div>
<div id="feedback">
<h3>Post a Comment:</h3>
<p>Pleas start your URL's with 'http://'. Your email
address will not be shown.</p>
<div id="form">
<form method="get" action="">
<input type="hidden" name="ENr" id="EntryNumber">
<div><label for="text">Message:</label><textarea
name="CContent" id="CContent" cols="20" rows="8"></textarea></div>
<div><label for="author">Name:</label><input
type="text" name="CAuthor" id="CAuthor" /></div>
<div><label for="email">E-mail:</label><input
type="text" name="CAuthorEMail" id="CAuthorEmail" /></div>
<div><label for="url">URL:</label><input
type="text" name="CAuthorURL" id="CAuthorURL" /><input type="submit"
name="button" value="Send" class="button"
onClick='javascript
:parent.frames["control"].addNewComment()'/></div>
</form>
</div>
</div>
<div id="footer">
<p> <a href="http://www.moonsunweb.com">MoonSun Web
Design</a> - Amo's Blog - 2005</p>
<div id="validator">
<a class="valid"
href="http://validator.w3.org/check/referer" title="Check the validity
of this site’s XHTML">xhtml</a>
<a
href="http://jigsaw.w3.org/css-validator/check/referer" title="Check the
validity of this site’s CSS">css</a>
</div>
</div>
</div>
</body>
</html>
------------------------------------------------------------------------
Empty.html:
------------------------------------------------------------------------
<html>
<head>
<title></title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
</body>
</html>
------------------------------------------------------------------------
frames.html:
<html>
<head>
<script>
<!--
var last_entries ='';
var entry = '';
function initIt()
{
setTimeout("Fbegin1()",300);
}
function Fbegin1()
{
serverLoad("example_0230366/scripts/list_last_entries.php?",
"afterList_last_entriesLoaded");
}
function afterList_last_entriesLoaded()
{
last_entries = parent.frames["Buffer"].document.buffer.line.value;
show_last_entries_menu();
}
function afterShow_last_entryLoaded()
{
entry = parent.frames["Buffer"].document.buffer.line.value;
show_last_entryLoaded();
}
function serverLoad(pX,rX)
{
var server="http://localhost/";
var url = server + pX + '&return=' + rX;
parent.frames["Buffer"].document.location.href=url;
}
function showEntry(ENr)
{
deleteNodeChilds("content");
parent.frames["blog"].document.getElementById("feedback").style.display
= "block";
parent.frames["blog"].document.getElementById("EntryNumber").value = ENr;
serverLoad("example_0230366/scripts/show_entry.php?ENr="+ENr,"afterShow_last_entryLoad ed");
}
function deleteNodeChilds(id)
{
var number =
parent.frames["blog"].document.getElementById(id).childNodes.length;
for(var i=0;i<number;i++)
{
var node =
parent.frames["blog"].document.getElementById(id).firstChild;
parent.frames["blog"].document.getElementById(id).removeChild(node);
}
}
function show_last_entries_menu()
{
var A = new Array();
var ax = new Array();
var myli,mya,myText;
var myul = document.createElement("ul");
A = last_entries.split('\n');
for(var i=0;i<A.length;i++)
{
ax = A[i].split('|');
if(i==0)
//parent.frames["blog"].document.getElementById("EntryNumber").value =
ax[0];
myli = document.createElement("li");
mya = document.createElement("a");
mya.href =
'javascript
:parent.frames["control"].showEntry("'+ax[0]+'")';
myText = document.createTextNode(ax[1]);
mya.appendChild(myText);
myli.appendChild(mya);
myul.appendChild(myli);
}
//parent.frames["blog"].document.getElementById("secondarynav").appendChi ld(myul);
serverLoad("example_0230366/scripts/show_last_entry.php?",
"afterShow_last_entryLoaded");
}
function show_last_entryLoaded()
{
var A = new Array();
var ax = new Array();
var i = 0;
var myh2,myh1,myp,MyText;
var mydiv,myh3,mydiv2,mya;
A = entry.split('\n');
ax= A[i].split('|');
myh2 = document.createElement("h2");
myText = document.createTextNode(ax[2]);
myh2.appendChild(myText);
myh1 = document.createElement("h1");
myText = document.createTextNode(ax[0]);
myh1.appendChild(myText);
myp = document.createElement("p");
myText = document.createTextNode(ax[1]);
myp.appendChild(myText);
parent.frames["blog"].document.getElementById("content").appendChild(my h2);
parent.frames["blog"].document.getElementById("content").appendChild(my h1);
parent.frames["blog"].document.getElementById("content").appendChild(my p);
if(A.length>1)
{
mydiv = document.createElement("div");
mydiv.id="comments";
myh3 = document.createElement("h3");
myText = document.createTextNode("Comments:");
myh3.appendChild(myText);
mydiv.appendChild(myh3);
for(i=1;i<A.length;i++)
{
ax = A[i].split('|');
mydiv2 = document.createElement("div");
mydiv2.className = "comment";
myp = document.createElement("p");
myText = document.createTextNode(ax[2]);
myp.appendChild(myText);
mydiv2.appendChild(myp);
myp = document.createElement("p");
myp.className="by";
myText = document.createTextNode("By ");
myp.appendChild(myText);
mya = document.createElement("a");
mya.href = ax[1];
myText = document.createTextNode(ax[0]);
mya.appendChild(myText);
myp.appendChild(mya);
myText = document.createTextNode(" on " + ax[3]);
myp.appendChild(myText);
mydiv2.appendChild(myp);
mydiv.appendChild(mydiv2);
}
parent.frames["blog"].document.getElementById("content").appendChild(my div);
}
}
//Add coment
var response = '';
function addNewComment ()
{
var ENr =
parent.frames["blog"].document.getElementById("EntryNumber").value;
var CContent =
parent.frames["blog"].document.getElementById("CContent").value;
var CAuthor =
parent.frames["blog"].document.getElementById("CAuthor").value;
var CAuthorURL =
parent.frames["blog"].document.getElementById("CAuthorURL").value;
var CAuthorEmail =
parent.frames["blog"].document.getElementById("CAuthorEmail").value;
serverLoad("example_0230366/scripts/add_comment.php?ENr="+ENr+"&CContent="+CContent+"& CAuthor="+CAuthor+"&CAuthorURL="+CAuthorURL+"&CAut horEmail="+CAuthorEmail,"afterAdd_commentLoaded");
}
function afterAdd_commentLoaded()
{
var entryNumber, message, response;
response = parent.frames["Buffer"].document.buffer.line.value;
var ax = new Array();
ax = response.split('|');
serverLoad("example_0230366/scripts/show_entry.php?ENr="+ax[1],"afterShow_last_entryLoaded");
}
// Archives Module
var archives = '';
function show_archives()
{
parent.frames["blog"].document.getElementById("decoration").src
= "images/archive_blog.jpg";
serverLoad("example_0230366/scripts/list_entries_by_topics.php?","afterListEntriesByTo picsLoaded");
}
function afterListEntriesByTopicsLoaded()
{
deleteNodeChilds("content");
parent.frames["blog"].document.getElementById("feedback").style.display
= "none";
archives = parent.frames["Buffer"].document.buffer.line.value;
write_list_entries_by_topics();
}
function write_list_entries_by_topics()
{
var A = new Array();
var ax = new Array();
var myli,mya,myText,myh3;
A = archives.split('\n');
for(var i=0;i<A.length;i++)
{
ax = A[i].split('|');
myh3 = document.createElement("h3");
myText = document.createTextNode(ax[0]);
myh3.appendChild(myText);
parent.frames["blog"].document.getElementById("content").appendChild(my h3);
var myul = document.createElement("ul");
for(x=1;x<ax.length-2;x++)
{
myli = document.createElement("li");
mya = document.createElement("a");
mya.href = 'javascript
:parent.frames["control"].showEntry("'+ax[x]+'")';
myText = document.createTextNode(ax[x+1]);
mya.appendChild(myText);
myli.appendChild(mya);
myText = document.createTextNode(" (" + ax[x+2]+")");
myli.appendChild(myText);
myul.appendChild(myli);
x = x+2;
}
parent.frames["blog"].document.getElementById("content").appendChild(my ul);
}
}
// Links
var links = '';
function show_links()
{
parent.frames["blog"].document.getElementById("decoration").src
= "images/links_blog.jpg";
serverLoad("example_0230366/scripts/show_links.php?","afterShowLinksLoaded");
}
function afterShowLinksLoaded()
{
links = parent.frames["Buffer"].document.buffer.line.value;
deleteNodeChilds("content");
parent.frames["blog"].document.getElementById("feedback").style.display
= "none";
write_links();
}
function write_links()
{
var A = new Array();
var ax = new Array();
var myli,mya,myText;
var myul = document.createElement("ul");
A = links.split('\n');
for(var i=0;i<A.length;i++)
{
ax = A[i].split('|');
myli = document.createElement("li");
mya = document.createElement("a");
mya.href = ax[0];
myText = document.createTextNode(ax[1]);
mya.appendChild(myText);
myli.appendChild(mya);
myul.appendChild(myli);
}
parent.frames["blog"].document.getElementById("content").appendChild(my ul);
}
-->
</script>
</head>
<body onLoad="initIt()"><p></p></body>
</html>