title: How to use Javascript as a backend script to make server side api calls without using HTML in Jint
body: <p>This <a href="https://softwareengineering.stackexchange.com/questions/250819/how-to-develop-cross-platform-mobile-applications-with-native-ui-and-javascript">link</a> sets up the context for this question.</p>
  
  <p>I am trying to use Javascript as the backend code for my mobile application(windows) which has a native UI(not HTML UI). That means I don't have HTML. Hence I don't have DOM.</p>
  
  <p>I have successfully been able to create functions which does some computation locally like add, call them from my C# or Java code and get the return values.</p>
  
  <p>Now I am running into 2 problems</p>
  
  <p>1) I am trying to take my javascript functions one step further by trying to call server apis from the Javascript using XMLHttpRequest. But I am getting a script execution exception in my C#(This usually occurs if the script was unable to run). I think this is because XMLHttpRequest needs DOM and I don't have DOM.</p>
  
  <p>If my first problem is solved then</p>
  
  <p>2)How to get hold of a different Javascript file when I don't have DOM. For example let's say I want to use Jquery to simplify my requests using $.Ajax etc, but how do I load the Jquery library because I don't have the luxury of script tag neither do I have the luxury of using $.getScript because I am trying to get Jquery itself.</p>
  
  <p>One possible solution</p>
  
  <p>There is one solution that I can think on top of my head. Use a webview and load your html in the WebView and use Jint for Javascript. But then the question arises How do I use WebView in par with Jint.</p>
  
  <p>I would be glad if someone can point me in the right direction.
  Thanks in advance.</p>