Hi everyone. I have some questions, which should be rather easy to reply, but as I am working on PHP, JavaScript, XML, CSS, Photoshop and other stuff at the same time, my head, which is about to explode, would be grateful for any answers :).
1) I have created a simple navigation system which loads local html documents on a main big DIV element in my page. Although greek language (iso-8859-7) is working outside that DIV, inside it i see question marks. My HTML files only contain <div>..More elements..</div>. I have tried calling complete HTML documents (with html, head, body etc elements) but no luck. Is that approach wrong? Any ideas why this happens?
2) I use JavaScript to dynamically generate gadgets on the sidebar of my page with the document.create Element() and SomeElement.app endChild() methods. Whatever element wasn't originally on the page though (the divs I create), gives a "parentObj is not defined" error when i remove it, but the result is ok. It seems like the document element content needs to be copied to the browser memory and be refreshed...
[CODE=javascript]function addSidebarEleme nt() {
var ni = document.getEle mentById('gadge ts');
var numi = document.getEle mentById('theVa lue');
var num = (document.getEl ementById('theV alue').value -1)+ 2;
numi.value = num;
var newdiv = document.create Element('div');
var divIdName = 'newgadget'+num ;
newdiv.setAttri bute('id',divId Name);
newdiv.setAttri bute('style','d isplay: none;');
newdiv.innerHTM L="<h2 onclick=\"Effec t.toggle('"+div IdName+"Content ','blind')\">"+ divIdName+"</h2><ul id=\""+divIdNam e+"Content\"><l i><a href=\"#\">Fusc e dui neque fringilla</a></li></ul><span onclick=\"remov eElement(this); \">Remove Gadget</span>";
ni.appendChild( newdiv);
Effect.SlideDow n(divIdName);
}
function removeElement(d ivObj) {
var parentObj = document.getEle mentById('gadge ts');
var childObj=divObj .parentNode;
var divId=childObj. getAttribute('i d');
Effect.SlideUp( divId);
setTimeout("par entObj.removeCh ild(childObj)", 2000);
}[/CODE]
Any explanations? I am worried that this problem is gonna make it worse after I add more stuff dynamically...
1) I have created a simple navigation system which loads local html documents on a main big DIV element in my page. Although greek language (iso-8859-7) is working outside that DIV, inside it i see question marks. My HTML files only contain <div>..More elements..</div>. I have tried calling complete HTML documents (with html, head, body etc elements) but no luck. Is that approach wrong? Any ideas why this happens?
2) I use JavaScript to dynamically generate gadgets on the sidebar of my page with the document.create Element() and SomeElement.app endChild() methods. Whatever element wasn't originally on the page though (the divs I create), gives a "parentObj is not defined" error when i remove it, but the result is ok. It seems like the document element content needs to be copied to the browser memory and be refreshed...
[CODE=javascript]function addSidebarEleme nt() {
var ni = document.getEle mentById('gadge ts');
var numi = document.getEle mentById('theVa lue');
var num = (document.getEl ementById('theV alue').value -1)+ 2;
numi.value = num;
var newdiv = document.create Element('div');
var divIdName = 'newgadget'+num ;
newdiv.setAttri bute('id',divId Name);
newdiv.setAttri bute('style','d isplay: none;');
newdiv.innerHTM L="<h2 onclick=\"Effec t.toggle('"+div IdName+"Content ','blind')\">"+ divIdName+"</h2><ul id=\""+divIdNam e+"Content\"><l i><a href=\"#\">Fusc e dui neque fringilla</a></li></ul><span onclick=\"remov eElement(this); \">Remove Gadget</span>";
ni.appendChild( newdiv);
Effect.SlideDow n(divIdName);
}
function removeElement(d ivObj) {
var parentObj = document.getEle mentById('gadge ts');
var childObj=divObj .parentNode;
var divId=childObj. getAttribute('i d');
Effect.SlideUp( divId);
setTimeout("par entObj.removeCh ild(childObj)", 2000);
}[/CODE]
Any explanations? I am worried that this problem is gonna make it worse after I add more stuff dynamically...
Comment