home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2005 March
/
PCWorld_2005-03_cd.bin
/
komunikace
/
kmeleon
/
kmeleon09.exe
/
toolkit.jar
/
content
/
global
/
netError.js
< prev
next >
Wrap
Text File
|
2002-10-31
|
2KB
|
72 lines
// Error url MUST be formatted like this:
// chrome://neterror.xhtml?e=error&u=url&d=desc
function getErrorCode()
{
url = document.location.href;
error = url.search(/e\=/);
duffUrl = url.search(/\&u\=/);
return unescape(url.slice(error + 2, duffUrl));
}
function getDuffUrl()
{
url = document.location.href;
duffUrl = url.search(/u\=/);
desc = url.search(/\&d\=/);
return unescape(url.slice(duffUrl + 2, desc));
}
function getDescription()
{
url = document.location.href;
desc = url.search(/d\=/);
return unescape(url.slice(desc + 2));
}
function retryThis() {
//var duffUrl = getDuffUrl();
//document.location.href = duffUrl;
document.location.href = document.getElementById("searchfield").value
}
function searchThis() {
searchForThis(document.getElementById("searchfield").value);
}
function searchForThis(url) {
document.location.href = "http://www.google.com/search?q=" + url;
}
function fillIn() {
var err = getErrorCode();
var duffUrl = getDuffUrl();
var i;
var titleText = document.getElementById(err + ".title").innerHTML;
document.title = titleText;
document.getElementById("title").firstChild.nodeValue = titleText;
//document.getElementById("title").firstChild.appendValue = titleText;
document.getElementById("shortDesc").firstChild.nodeValue = getDescription();
document.getElementById("longDesc").firstChild.nodeValue = document.getElementById(err + ".longDesc").innerHTML;
document.getElementById("searchfield").value = duffUrl;
/*
// Fill in the short description
var sd = document.getElementById("shortDesc");
for (i = 0; i < sd.childNodes.length; i++)
{
var n = sd.childNodes.item(i);
if (n.nodeType == Node.TEXT_NODE) {
n.nodeValue = getDescription();
break;
}
}
// Long description
var d = document.getElementById(err);
d.setAttribute("style", "display:block;");
*/
}