Total members 11890 |It is currently Thu Apr 25, 2024 1:06 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Hi,

I have used the following code that works perfectly well with I.E., but does not display anything with Firefox:

<!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>
<TITLE></TITLE>
<SCRIPT language = "javascript" TYPE = "text/javascript">
<!-- Start hiding JavaScript statements

var Request = false;
if (window.XMLHttpRequest) {
Request = new XMLHttpRequest();
} else if (window.ActiveXObject) {
Request = new ActiveXObject("Microsoft.XMLHTTP");
}

function Display(url) {
if(Request) {
Request.open("GET", url);
Request.onreadystatechange = function()
{
if (Request.readyState == 4 && Request.status == 200) {
ModifyDOM(Request.responseText)

}
}
Request.send(null);
}
}

function ModifyDOM(storyText) {
var newText = document.createTextNode(storyText);
var newLine = document.createElement("<br/>");
document.getElementById('trgtP').appendChild(newText);
document.getElementById('trgtP').appendChild(newLine);

}

End hiding JavaScript statements -->
</SCRIPT>
</HEAD>

<BODY>
<table>
<tr>
<td><img src="xyz.jpg" width = 200 height = 200/></td>

<td><p id = "trgtP"></td>
</tr>
<tr>
<td colspan="3"><a href="#" onclick = "Display('Color.txt')">Colors Available</a></td>
</tr>

</table>
<hr/>

</BODY>
</HTML>



Could you please help me... I have just started using AJAX and I can't understand why no results is displayed using firefox, even if I inserted a set of coding at the top that is supposed to support different browsers.

Thanks,

Joey





Author:
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : Browser Support
 AJAX - Browser support     -  
 $.browser Check if your browser is IE or FireFox or Chrome     -  
 Looking for IT Support Job     -  
 Looking for Work in IT Support     -  
 Arabic Support in JSF     -  
 Browser     -  
 how can we get browser information in jsp?     -  
 Component subclasses that support painting     -  
 Whats your favourite browser?     -  
 Support Vector Machine coding on Matlab...     -  



cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com