API_DoQuery using non-Internet Explorer Browser

  • 0
  • 1
  • Question
  • Updated 6 years ago
  • Answered
It appears the Quickbase queries only work in the Internet Explorer database. I am using the:

xmlDB = new ActiveXObject("Microsoft.XMLDOM");

object, maybe this is why.

Is there anyway via JavaScript within the html page to invoke these queries without using this Microsoft Object and if so, how?

David

Photo of David W. Brown

David W. Brown

  • 0 Points

Posted 6 years ago

  • 0
  • 1
Photo of David W. Brown

David W. Brown

  • 0 Points
Good question, I'm trying to do the same thing with the following code: I get and xml object back, but can't parse it etc........The GetElementByID doesn't think it's an XML file. I tried using the .responsexml also.

<script language="javascript" type="text/javascript">
function GetData() { alert("Getdata"); var xmlHttp = null; var qdbURL; qdbURL = "https://octo.quickbase.com/db/bhvpfcgtf?a=API_DoQuery&query={6.EX.'"; qdbURL += document.getElementById('username').value; qdbURL += "'};"; alert(qdbURL); xmlHttp = new XMLHttpRequest(); xmlHttp.open("GET", qdbURL, false); xmlHttp.send(); var xmlDoc = xmlHttp.response; alert(xmlDoc); alert(xmlDoc.getElementsByTagName("update_id").value); alert("done!"); }</script>
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,434 Points 20k badge 2x thumb
You have multiple issues with your code the first of which is what URL you are trying to form using the variable qdbURL. Specifically, where is this username id used:

document.getElementById('username').value;

I don't know of any QuickBase page which has within it an element with an id attribute value of username.

Also, you are working at too low a level with your JavaScript in creating an XMLHttpRequest object. You should use a library such as jQuery to do the low level DOM work.