Search code examples
phpcontextmenulanguagetool

Develop Context Menu(dropdown) of LanguageTool


I'm recieving the response from languagetool server and its giving me result which I'm storing in JSON file. Now, I want to make it contextmenu(dropdown) which show inside the textarea. Like this https://languagetool.org/editor/5087698. I've seen the whole internet but nowhere could find the code(hint) to develop the context-menu of incoming response from server. Here's my result: My WebPage

This is the code through which I'm getting response from server.

$json = json_encode($result);$bytes = file_put_contents("result.json", $json); $str = file_get_contents('result.json'); $json_pretty = json_decode($str, true); echo $json_pretty."<br>";

Solution

  • I've developed the whole context-menu of languagetool by storing API result from server inside JSON file and calling specific word suggestions according to the position of word. Highlighted the wrong words or grammar etc.