JavaScript differences between IE 11 and Edge?

 0 Replies
 2 Subscribed to this topic
 12 Subscribed to this forum
Sort:
Author
Messages
PBL
Basic Member
Posts: 9
Basic Member

    Using Design Studio, the following JavaScript was added to AP20.1 to retrieve the Requester for a PO.  When run in IE 11 (in default Edge emulation mode) on Windows 7, it runs successfully - the count shows that 1 record was retrieved and the vRequester variable is set to the Requester from the database.  When run in Edge on Windows 10, the count also shows that 1 record was retrieved, but vRequester is always blank.

         var strPDL = portalWnd.oUserProfile.getAttribute("productline");
         var s = https://server + portalWnd.DMEPath;
         s += "?PROD="+strPDL;
         s += "&FILE=POLINESRC";
         s += "&INDEX=PLSSET1";
         s += "&KEY=" + parseInt(CoNbr,10);
         s += "= =";
         s += escape(PONbr);
         s += "&FIELD=REQUESTER";
         s += "&OUT=XML&DELIM=~";
         var sReturn=portalWnd.httpRequest(s);
         var vObjDMEXML = new portalWnd.DataStorage(sReturn);
         var vRecords = vObjDMEXML.document.getElementsByTagName("RECORD");
         var count = vObjDMEXML.document.getElementsByTagName("RECORDS")[0].getAttribute("count");    
         if (count > 0) var vCols = vRecords[0].getElementsByTagName("COL");
         var vRequester = vCols[0].firstChild.data;  

    I was told that I should use firstElementChild. instead of .firstChild.  However, I'm struggling to get firstElementChild to work.  Does anyone have an example of use of firstElementChild to extract returned data from a DME call? 

    Thank you