1

My intention is to do sandhi on text inputted by the user.

I am trying to import this sanskrit external sandhi rules module for node.js into my code and use the functions.

My html is as follows:

<input id='inpo1' class= 'inpo' type='text'/>
<input id='inpo2' class= 'inpo' type='text'/>
<textarea id='res' readonly></textarea>
<button id='print'>
print
</button>

My js is as follows:

$("#print").click(function() {
    var inpo1 = $("#inpo1").val();
  var inpo2 = $("#inpo2").val();
    $("#res").val(sandhi(inpo1, inpo2));
});

However, it does not work as expected.

Echchama Nayak
  • 971
  • 3
  • 23
  • 44
  • @LouysPatriceBessette Look like it's a local plugin, like Indian , but no idea what it do , OP should update the post about why used this and what expected – Pedram Nov 26 '17 at 12:08
  • Console errors? Network errors? `$(this).val() + " ";` does not do anything useful – mplungjan Nov 26 '17 at 12:13
  • 1
    Also it is for NODE.js and is calling `require` which does not run in a browser – mplungjan Nov 26 '17 at 12:16
  • @mplungjan Sorry, that was a typo – Echchama Nayak Nov 26 '17 at 12:24
  • Since it seems that this module was written to only run on Node.js, you'll probably have to use something like [browserify](http://browserify.org/) to bundle it before using it in the browser. I think there are other bundlers that can do similar things, but I've only ever needed to work with Node code in Node, so I haven't explored that enough to be help with that. – Useless Code Nov 26 '17 at 13:06

0 Answers0