Convert PHP script to JavaScript
Convert PHP script to JavaScript
Convert PHP script to JavaScript
Code to create a timer till a specific datetime.
ES9 provides syntactic support for asynchronous iteration - synchronous iterators and asynchronous iterables, which is just like regular iterators, except that they have a next() method that returns in Promise.
forEach can be used just like a traditional 'for loop' that iterates each of the array element once.
You can stop the event propagation by doing this – function stopEventPropagation(event) { if (event.stopPropagation) { event.stopPropagation(); // W3C model } else { event.cancelBubble = true; // IE model } }
Here is the function: function getXmlString(xmlDoc) { try { return ((new XMLSerializer()).serializeToString(xmlDoc)); } catch (e) { try { // Internet Explorer. return (xmlDoc.xml); } catch (e) { //Strange Browser ?? return (‘Xmlserializer not supported’); } } }
Here is the function: function transFormXml(xmlData, xsltData) { try { try { return xmlData.transformNode(xsltData); } catch (e) { var xsltProcessor = new XSLTProcessor(); xsltProcessor.importStylesheet(xsltData); return getXmlString(xsltProcessor.transformToFragment(xmlData, document)); } } catch (e) { alert(e); } return null; }