XML DOM Parsing in Javascript

XML parser reads XML, and converts it into an XML DOM object that can be accessed with JavaScript. Example : Javascript Snippet var str_inputxml = “<root><row id=’1′>One</row><row id=’2′>Two</row></root>”; var obj_parser=new DOMParser; var obj_xml = obj_parser.parseFromString(str_inputxml, “text/xml”); var obj_rows=obj_xml.selectNodes(“/root/row”); var text; //Select Text Node if(obj_rows.length>0) { text = obj_rows.item(0).text; } //Select…

Continue reading

String Replace All – Javascript

In general JavaScript replace function replaces the first occurrence in the string. It takes two parameters , first parameter to find the string and second parameter is string to replace when it found. Replace Snippet : var str = “Javascript find Function”; str = str.replace(“find”,”replace”); Replace All Snippet : var…

Continue reading

Sencha – Image service

Sencha.io – An great image service ,It help you dynamically resize images on various mobile screens. How to use sencha.io src To use Sencha.io Src in its default mode, you simply prefix your absolute src attribute with http://src.sencha.io/ An Example for above image <img title=”sencha-io” src=”http://src.sencha.io/http://www.imstalin.com/wp-content/uploads/sencha-io-diagrams-src.png” alt=”” width=”348″ height=”204″ />

Continue reading