•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 330,339 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,717 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 316 | Replies: 2
![]() |
•
•
Join Date: May 2008
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
------------PART ONE------------------
------------PART TWO------------------
syntax Syntax (Toggle Plain Text)
if(navigator.appName == "Netscape"){ xmlHttp = new XMLHttpRequest(); xmlHttp.open("GET",xmlfile , false); xmlHttp.send(null); docObj = xmlHttp.responseXML; var objNodesname = docObj.getElementsByTagName("name"); }else{ var docObj = new ActiveXObject("MSXML.DOMDocument"); docObj.load(xmlfile); var objNodesname = docObj.getElementsByTagName("name"); }
------------PART TWO------------------
syntax Syntax (Toggle Plain Text)
for (i = 0 ; i < objNodesnames.length ; i++) { if(navigator.appName == "Netscape"){ objcurrent=objNodesnames.item(i); myceltext=objcurrent.childNodes.item(0); currenttext=document.createTextNode(myceltext.data); lstring=currenttext.data; lstring=lstring.substr(4) lstringcode=lstring.substr(0,4) }else{ lstring=objNodesnames.item(i).text; lstringcode=lstring.substr(0,4); lstring=lstring.substr(4); }
•
•
Join Date: May 2008
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 2
Try something like this to replace the first code:
The second bit of code should work fine applying the same logic: don't check for the actual browser (especially Netscape) but check if the element your trying to use exists in the browser.
function getXHR()
{
/* Used to retrieve and XML HTTP Request object
Output: an XMLHttpRequest object
*/
var XHR;
// First determine user's browser
if (window.XMLHttpRequest) // Non-IE browser such as FireFox or Netscape
{
return new XMLHttpRequest();
}
else if (window.ActiveXObject) // IE
{
return new ActiveXObject("Microsoft.XMLHTTP");
}
else
{
// Assume browser doesn't support AJAX technologies
}
}The second bit of code should work fine applying the same logic: don't check for the actual browser (especially Netscape) but check if the element your trying to use exists in the browser.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
DaniWeb Marketplace (Sponsored Links)
•
•
•
•
addiction beta blackberry bon browser browsers browsing code injection development echo email encryption epilepsy eu europe firefox gecko griefers hackers home html internet internet explorer internet explorer 7 javascript leak linux memory microsoft mozilla networking news open source open-source opera patch phishing scams security social software super survey teleworking testing users web webmail work
- Java Script codes (JavaScript / DHTML / AJAX)
- Browser Battle -- Your TOP Pick! (Geeks' Lounge)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Ajax is new to me
- Next Thread: HTML


Linear Mode