WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 Javascript oop question, sam conrad, September 29, 2003
     Re:Javascript oop question, Brian R. James, September 29, 2003
         Re:Javascript oop question, Brian R. James, September 29, 2003
             Thanks!!, sam, September 29, 2003

Subject: Thanks!! From: sam Date: September 29, 2003

Thank you Brian; your solution works perfectly!!!

cheers

sam

From: Brian R. James
Sent: September 29, 2003
Subject: Re:Javascript oop question

Here is some example code:

function xmlNode()
{
 this.xml = new String();
 this.text = new String();
 this.length = new Number();
}

function xmlDOM(data)
{
 this.childNodes = data;
 this.selectSingleNode = selectSingleNode;
 
 function selectSingleNode(_parms)
 {
         for (var i = 0; i < this.childNodes.length; i++)
         {
   if (this.childNodes[i] == _parms)
   {
    var myNode = new xmlNode();
    myNode.xml = "<xml>" + this.childNodes[i] + "</xml>";
    myNode.text = this.childNodes[i];
    myNode.length = this.childNodes[i].length;
    return myNode;
   }
  }
  return null;
 }
}

var myData = ["1", "2", "3"];
var myDOM = new xmlDOM(myData);
alert(myDOM.selectSingleNode("2").xml);

Brian R. James





Reply
Name: 
Email: 
Subject: 

Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.


View All Messages
Back to WebFX