Implementing the state machine for the web interface

I intend to develop a final state machine as follows.

  • Retrieve management identifiers from → web pages,
  • Write control identifiers in XML → Controls - XML.
  • Manually declare state and transition in -> XML Controls
  • Scan Controls-XML and attach pre-declared Jscript to event handlers that paste them into a web page →. 5.

As much as possible.

Can I get into a can of worms?

+3
source share
1 answer

First, we live in a bank of worms!

, , , , , , , .

,

, - ( , , ), .

, :

function scan(e) {
  if (e&&e.childNodes)
  for(var i=0;i<e.childNodes.length;i++) {
    var child=e.childNodes[i];
    if (child) {
      if(child.id) console.log(child.nodeName,child.id);
      scan(child);
    }
  }
}

note: chrome, , .

, :

scan(document)

( ) , , ... eazy, , INPUT, SELECT TEXTAREA ..

XML

, , XML- XML-. , xml ( ), XML-

function makeNode(text) {
var doc;
if (window.ActiveXObject) {
    doc=new ActiveXObject("Microsoft.XMLDOM");
    doc.async="false";
    doc.loadXML(text);
} else {// code for Mozilla, Firefox, Opera, etc.
    var parser=new DOMParser();
    doc=parser.parseFromString(text,"text/xml");
}// documentElement always represents the root node
return doc.documentElement;
}

aproach - XML- ( ), XML-, XMLDOM .

→ -XML

, (XML doc) / ? , ?

, XML, .

- XML ​​ Jscript , -

, , XMLDOM xml .

, ( getElementById)

, - , , XML , . .

+1

Source: https://habr.com/ru/post/1730518/


All Articles