firefox probléma permission denied.
Sziasztok,
Olyan problémával szenvedek, hogy ha firefox alatt a
document.domain értékét beállítom egy adott domain-re akkor az alábbi
kód nem tudd a létrehozott documentumhoz semmilyen elemet hozzáadni, permission denied üzenetet kapok.
THX.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<script>
var old_dom = document.domain;
document.domain = '.....'; <- az adott domain
alert(document.domain);
function importXML()
{
if (document.implementation && document.implementation.createDocument)
{
xmlDoc = document.implementation.createDocument("", "", null);
if (xmlDoc.readyState == null) {
xmlDoc.readyState = 1;
xmlDoc.addEventListener("load", function () {
xmlDoc.readyState = 4;
if (typeof xmlDoc.onreadystatechange == "function")
xmlDoc.onreadystatechange();
}, false);
}
return xmlDoc;
}
else if (window.ActiveXObject)
{
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.onreadystatechange = function () {
if (xmlDoc.readyState == 4) createT()
};
}
else
{
alert('Your browser can\'t handle this script');
return;
}
}
function createT() {
if (xmlDoc != null) {
var root = xmlDoc.createElement('gods');
if (xmlDoc.documentElement) {
xmlDoc.replaceChild(root, xmlDoc.documentElement);
}
else {
xmlDoc.appendChild(root);
}
var god = xmlDoc.createElement('god');
god.appendChild(xmlDoc.createTextNode('Kibo'));
root.appendChild(god);
if (typeof XMLSerializer != 'undefined') {
alert(new XMLSerializer().serializeToString(xmlDoc));
}
else {
alert(xmlDoc.xml);
}
}
}
importXML();
createT();
</script>
<P ID="writeroot">
</P>
</body>
</html>
■ Olyan problémával szenvedek, hogy ha firefox alatt a
document.domain értékét beállítom egy adott domain-re akkor az alábbi
kód nem tudd a létrehozott documentumhoz semmilyen elemet hozzáadni, permission denied üzenetet kapok.
THX.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<script>
var old_dom = document.domain;
document.domain = '.....'; <- az adott domain
alert(document.domain);
function importXML()
{
if (document.implementation && document.implementation.createDocument)
{
xmlDoc = document.implementation.createDocument("", "", null);
if (xmlDoc.readyState == null) {
xmlDoc.readyState = 1;
xmlDoc.addEventListener("load", function () {
xmlDoc.readyState = 4;
if (typeof xmlDoc.onreadystatechange == "function")
xmlDoc.onreadystatechange();
}, false);
}
return xmlDoc;
}
else if (window.ActiveXObject)
{
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.onreadystatechange = function () {
if (xmlDoc.readyState == 4) createT()
};
}
else
{
alert('Your browser can\'t handle this script');
return;
}
}
function createT() {
if (xmlDoc != null) {
var root = xmlDoc.createElement('gods');
if (xmlDoc.documentElement) {
xmlDoc.replaceChild(root, xmlDoc.documentElement);
}
else {
xmlDoc.appendChild(root);
}
var god = xmlDoc.createElement('god');
god.appendChild(xmlDoc.createTextNode('Kibo'));
root.appendChild(god);
if (typeof XMLSerializer != 'undefined') {
alert(new XMLSerializer().serializeToString(xmlDoc));
}
else {
alert(xmlDoc.xml);
}
}
}
importXML();
createT();
</script>
<P ID="writeroot">
</P>
</body>
</html>
Félig-meddig statikus érték
Egy kis irodalom: http://htmlinfo.polyhistor.hu/js13ref/document.htm#1193628
document.domain