Bir çok html kodu çalışmıyor.

  • Bilinmeyen adlı kullanıcının avatarı

    <!DOCTYPE html>
    <html>
    <head>

    <title>Sozluk</title>
    <link rel=”stylesheet” type=”text/css” href=”style.css”>

    </head>
    <body>
    <div class=”header”>
    <h1>Turkic Dictionary</h1>

    </div>
    <div class=”wrapper”>
    <div class=”words”>
    <input type=”text” id=”search” placeholder=”search …”>
    <button onclick=”search()”>Go</button>

    <ul id=”word_list”>

    </div>

    <div class=”word”>
    <h3 id=”word_text”></h3>
    <p id=”definition”></p>

    <hr>

    <h3>Related words:</h3>
    <li id=”related”>

    </div>

    </div>
    </body>
    </html>
    <script type=”text/javascript”>
    var dictionary = [
    {
    word:”apple”,
    def:”Elma bildiğimiz”,
    rel:[“mango”,”pear”]
    },
    {
    word:”ball”,
    def:”top bildiğimiz”,
    rel:[“scoore”,”football”]
    },
    {
    word:”banana”,
    def:”muz bildiğimiz”,
    rel:[“Africa”,”tropical”]
    },
    ];

    init = function () {
    for (var i = 0; i < dictionary.length; i++) {
    document.getElementById(‘word_list’).innerHTML += “<li onclick=’show(” + i + “)’>” + dictionary[i].word + ““;
    }

    init();

    show = function (i) {
    document.getElementById(‘word_text’).innerHTML = dictionary[i].word;
    document.getElementById(‘definition’).innerHTML = dictionary[i].def;

    var list = “”;

    for (var j = 0; j < dictionary[i].rel.length; j++) {
    list += “

  • ” + dictionary[i].rel[j] + “
  • “;
    document.getElementById(‘related’).innerHTML = list;

    }

    }

    }

    show(0);

    search = function () {
    query = document.getElementById(‘search’).value;

    if (query == “”) {
    return
    }

    found = -1;

    for (var i = 0; i < dictionary.length; i++) {
    if (query == dictionary[i]word) {
    found = i;
    break;
    }else {
    document.getElementById(‘word_list’).innerHTML = “Word not found”;
    document.getElementById(‘definition’).innerHTML = “word is not here”;
    document.getElementById(‘related’).innerHTML = “related not found”;
    }
    }

    if (found >= 0) {
    show(found);
    }

    }

    </script>

    Yardım istediğim blog (yalnızca oturum açmış kullanıcılar tarafından görülebilir).