How do I grab stuff from my website on a local html file

So for my second screen display, I want to grab the customer data and previous purchases from my online database and website. I orginally went through SambaPOS printing out the info in the print template and using scripts to get to the info but this didnt work as there was a noticable lag whilst the info would be downloaded, somtimes causing Samba to go unresponsive. I was at first thinking that I would simply be able to add some AJAX stuff into the print template to retrieve everything from the website once the html has been loaded but I came across the problem of cross domain data calls.

I was wondeirng if anyone here has any experience getting data from a website.

For refence, I will have a url like
And at first when the page gets displayed on the second screen it would go loading before turning into the data that url would return

Well, Ive spent a bit of time working on it and have seemed to got everthing working
Here is my printer template:

<!-- saved from url=(0014)about:internet -->
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="css/cover.css">
<!-- Optional theme -->
<link rel="stylesheet" href="" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->

<script src="" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
html {
overflow: auto;
h1 {text-align:center;}
h2 {text-align:center;}
<script type = "text/javascript">
function closeWindows() {
height: 100%;
z-index: 9999;
background-color: Transparent;
border: none;
overflow: hidden;

<script type="text/javascript">
var exload = 0;
[=TN('{ENTITY DATA:Points}') > 0 ? '
<div id="load">
<script type="text/javascript">
exload = 1;

' : '
<h1> Welcome {ENTITY DATA:CName}</h1>
<h2>Year: {ENTITY DATA:Year} </h2>
<h1>Purchase 6 more drinks for a </h1>
<h1>Free one!</h1>
' ]
<script type="text/javascript">

if (exload) {
$.ajaxSetup({cache: false});
   var url = "" + {ENTITY NAME} ;          



The trick was injecting some fake headers into the php file to allow browsers to download the file from it.

Out of itnerest, should I not be usin a CDN to get bootstrap/jquery. Does that mean every time I open it it will download?

1 Like

The Browser will probably cache that to avoid downloading every time. If you can look at the Network log in DevTools, you can know for sure.

That said, I generally tend to host library files locally on the webserver, so there is no reliance on 3rd-party sites, and it keeps internet traffic to a minimum because of that. It is just a preference of mine. It is especially useful when the SambaPOS Server is also the Webserver, and if you have no internet connection, you can still host and request pages on your local network. If you were to use a CDN in that case, the GET for the libraries would fail, and in turn, so would the site. Locally hosted does not have this dependency, and it will be much faster than retrieving libraries from the CDN.