Javascript throwing error in IE. Works ok with Chrome.

  • 1
  • 2
  • Question
  • Updated 1 year ago
  • Answered
I am calling the DoQuery() and AddRecord() APIs from the JavaScript. It works like a charm in chorme, However, its throwing me error in IE.The error it throws on the console: : 'XPathEvaluator' is undefined. Any ideas on how to get this working?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">;
<html>
 <meta http-equiv="X-UA-COMPATIBLE" content="IE=Edge,chrome=IE8,IE10">
 <body>
  
  <script type="text/javascript" src="/js/QuickBaseClient.js"></script>
  <script type="text/javascript">

   var qdb = new QuickBaseClient();
   qdb.SetAppToken("apptoken");

   var fun= function() {
   
   var rrid= qdb.parseQueryString();
   
   if((rrid['rid'] == "")) {
     alert("Error, undefined variables present");
     return;
    }

   var rid=rrid['rid'];


   var queryString  = "{fid.EX."+rrid['rid']+"}";
   
  //Do Query

//Add Query


 
   };
   
   fun();


   
  </script>

 </body>
</html>
Photo of Angel

Angel

  • 724 Points 500 badge 2x thumb

Posted 1 year ago

  • 1
  • 2
Photo of Angel

Angel

  • 724 Points 500 badge 2x thumb
Still unable to find a solution to this. Shoutout to experts on javascript
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,512 Points 20k badge 2x thumb
Short answer is don't use QuickBaseClient.js - it is archaic in many ways and isn't really even supported by QuickBase.

An answer from 2004 states:

Internet Explorer is the only browser that now doesn't support XPathEvaluator. You can use selectNode() and selectSingleNode() on the DOM Document object instead (IE only).

All of these constructs are outdated even if the browsers may support them.

For what is it worth I can log XPathValidator in the console of Chrome, Firefox and Edge but I can't test on IE browsers. So try Edge instead of IE if you are on a Microsoft box.
(Edited)