I have 2 problems: 1.IE, XML and Space I need to parse something with java script.The problem is how internet explorer understand space?Un example: <Li> <index>Li_j</index> <name>Lithium</name> <atomic_number>3</atomic_number> <relative_atomic_mass>6.941000</relative_atomic_mass> <melting_point>180.539993</melting_point> <boiling_point>1342.000000</boiling_point> <density>0.530000</density> <covalent_radius>1.230000</covalent_radius> <atomic_radius>2.050000</atomic_radius> <atomic_volume>13.100000</atomic_volume> </Li> <Na> <index>Li_j</index> <name>Lithium</name> <atomic_number>3</atomic_number> <relative_atomic_mass> </relative_atomic_mass> <melting_point> </melting_point> <boiling_point>1342.000000</boiling_point> <density>0.530000</density> <covalent_radius>1.230000</covalent_radius> <atomic_radius>2.050000</atomic_radius> <atomic_volume>13.100000</atomic_volume> </Na> Code (markup): Look at the bold code.When I parse I need to parse a space. I select a radio button and put in a div : 180.539993 the value for melting point from Li.When I select another radio button I need to put in the same div a space, but is not doing to do that, it keep the previous and give me a java script error. Yes I can put another value and tested and when I parse this value to put space instead in div, but I have to do many modifications to code and that is not realy a option.My question is what to put in the XML <melting_point>SPACE</melting_point> that IE consider it a space? 2.Ajax and Browser Cache When I request a particular web page, the browser first tries to load the page from its cache, rather than submitting a new HTTP request. If I use a php url I wil use something like this myRandom=parseInt(Math.random()*99999999); myRequest.open("GET", url + myRandom, true); Code (markup): or I use the current timestamp myRand= + new Date().getTime(); Code (markup): But the problem is I parse with java scripts text and xml files(url) not php and the trick above is not working with this kind of file. I can add HTTP headers to the data returned by server-side routines, intended to tell the browser not to cache a particular page,but different browsers have different cache support different header declarations, making it difficult to ensure that pages are not cached. What I can do in this situation ?
1.- Try using entities ampersand#32; or Code (markup): instead of space. NOTE: Replace "ampersand" with a real ampersand (can't display ok here on DP). 2.- Using HTTP headers (Expires option) as you said "it difficult to ensure that pages are not cached", not only for browsers cache, even because of proxies cache. My suggestion is using "url mod rewrite" (you can see help on Apache Web Server). Browser request a php with random parameter, and your server replies with a .xml file
It is not working ; the   not at all and the solution with ampersand gives errors "Object required" and block the page when I select other button. You use that and works? Here it is the java script code that I use to get values from HTML: document.getElementById(index_nodes[counter].firstChild.nodeValue).value=density_nodes[counter].firstChild.nodeValue Code (markup): I FF works because they use space like and element but in IE is the problem.
With your XML data would be ok this procedure ? If no text or only white spaces -> I put only a space else -> I put value function CleanEmptySymbols( string ) { // string = string.replace('\r', '') // string = string.replace('\n', '') string = string.replace(' ', '') return (string.length == 0) ? false : true } var aux = density_nodes[counter].firstChild.nodeValue; if ( CleanEmptySymbols(aux) ) { document.getElementById(index_nodes[counter].firstChild.nodeValue).value = density_nodes[counter].firstChild.nodeValue; } else { document.getElementById(index_nodes[counter].firstChild.nodeValue).value = ' '; } Code (markup):