|
Subject:
|
Problem with styles
|
|
Posted By:
|
toddw607
|
Post Date:
|
6/3/2008 10:29:03 AM
|
Hello all, i have the following javascript program: xmlDoc = document.implementation.createDocument("","",null);
xmlDoc.async=false;
xmlDoc.load("homepage_moz.xml");
document.write('<p class="headline">')
document.write(xmlDoc.getElementsByTagName("heading")[0].childNodes[0].nodeValue)
document.write('</p>')
document.write('<p class="centertext">'+xmlDoc.getElementsByTagName("paragraph")[0].childNodes[0].nodeValue+'</p>'+'<a href="#ils">'+xmlDoc.getElementsByTagName("link")[0].childNodes[0].nodeValue+'</a>')
document.write('<p class="centertext">'+xmlDoc.getElementsByTagName("paragraph")[1].childNodes[0].nodeValue+'</p>')
document.write('<a href="#manuals">'+xmlDoc.getElementsByTagName("link")[1].childNodes[0].nodeValue+'</a>')
document.write('<p class="centertext">'+xmlDoc.getElementsByTagName("paragraph")[3].childNodes[0].nodeValue+'</p>')
document.write('<a href ="#transit"> '+xmlDoc.getElementsByTagName("link")[2].childNodes[0].nodeValue+'</a>')
document.write('<p class="centertext">'+xmlDoc.getElementsByTagName("paragraph")[5].childNodes[0].nodeValue+'</p>')
document.write('<a href="#contact"> '+xmlDoc.getElementsByTagName("link")[3].childNodes[0].nodeValue+'</a>')
document.write('<p class="borderline"></p>') All this does is writes from a xml document to a xml document when when I do this (In Mozilla) all the links are aligned to the upper right hand side of the screen and all the entries are on seperate lines (Each being their own paragraph when using document.write should alleviate the seperate lines). Any thoughts on this? There is nothing to my knowledge in the CSS that would do this. Any help would be greatly appreciated. TIA
|
|
Reply By:
|
vinod_yadav1919
|
Reply Date:
|
6/3/2008 11:40:43 AM
|
HI toddw607!!
Could you please confirm the css file is loaded before this code is written to the page??
Cheers :)
vinod
|
|
Reply By:
|
toddw607
|
Reply Date:
|
6/3/2008 11:48:10 AM
|
Hi Vinod, Thanks for the RE. The html page that is actually displayed is called index.html and this javascript function is called from within the <head> of that program which then loads the homepage_moz.xml page from it. The css is loaded from the index.html file within the head tag before this javascript function is called. I also made alteration to it and they worked with this page so I know it's loaded. Do you think this problem lies within the javascript or CSS? Thanks Again!
|
|
Reply By:
|
vinod_yadav1919
|
Reply Date:
|
6/3/2008 12:37:00 PM
|
Yes I do think so.. I got the same issue with one of my .net application.
you can do one more thing?? after page load you try to reload the css with the help DOM..
Note-I tried it ,it worked for me...
Cheers :)
vinod
|