2

I'm currently trying to receive word information from Wiktionary, as said in the title. However, doing this approach doesn't work:

<html>
    <head>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
        <script type="text/javascript">

        function search(){

            var a = document.getElementById('search');
            var b = document.getElementById('content');

            $.ajax({dataType: 'text/html', url: 'http://pl.wiktionary.org/w/index.php?title=' + a.value + '&printable=yes', success: function(data) { b.innerHTML = data; } });

        }

        </script>
    </head>
    <body>
        <p>
            <textarea id="search" rows="1" cols="40" style="resize: none;"></textarea>
            <button onclick="search();">Search</button>
        </p>
        <p id="content">x</p>
    </body>
</html>

When I enter a word(eg. myszka[little mouse]), it does not change the element's inner content and the console doesn't show anything either. The query, however, seems to work, as I'll get an 404 error when entering a word that doesn't exist.

Is it something obvious I'm missing, or...?

Thanks in advance

roalz
  • 2,699
  • 3
  • 25
  • 42
Arno Nymo
  • 39
  • 9
  • Bit late, but that is the Polish wiktionary that has definitions in **Polish**. Are you sure you want that? – Aryaman Dec 04 '17 at 23:24

0 Answers0