-1

I've a Javascript app(Not a Node.js one, actually runs on Apache Httpd) which has to recieve data from custom server. So my server sends a post request and i've to recieve it client side javascript. Is there any way to achieve this?

Thanks in Advance

Scorypto
  • 306
  • 2
  • 4

1 Answers1

0

If only your server is able to fetch that data, then you can bootstrap it in your template:

Pseudo code, assuming php is used:

<head>
    <script>
        echo( 'var obj=' . $my_fetched_value . ';' );
    </script>
</head>

Then in your whatever script:

console.log( obj );
Ingmars
  • 998
  • 5
  • 10