Can't get API_GetRecordAsHTML to work

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered

I am trying to use API_GetRecordAsHTML to work, but so far no luck. I know very little to no javascript, so I'm trying to figure out what could be wrong. Also, just wanting to make sure the API documentation is correct - I did find a </head> tag out of place in the example on the reference page, so just making sure there isn't more that is wrong in the example code.

In the code below, the API URL I have in the javascript works fine when pasted into a browser, but not here. 

I can save this file locally (with correct info for tokens, db, etc), open it in a browser, and the hard-coded HTML shows fine, but the API results do not show. 


https://gist.github.com/porkozone/fac5ad4047c1645021d4dffbd3e55691

Photo of Scott

Scott

  • 50 Points

Posted 3 years ago

  • 0
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,264 Points 20k badge 2x thumb
Your code appears to be derived from the example in the API documentation. That example assumed jQuery was already loaded on the page. So include jQuery using code similar to this (substitute angle brackets for hard brackets):

[script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.3/jquery.min.js"][/script]