首页 \ 问答 \ 如何检查符合html5 / css3的网页[关闭](how to check for html5/css3 compliant web pages [closed])

如何检查符合html5 / css3的网页[关闭](how to check for html5/css3 compliant web pages [closed])

我们正在使用HTML5 / CSS3 / JQUERY为基于Web的应用程序构建基于Web的应用程序前端。 我们现在正在使用萤火虫,这对我们没有帮助。 我想知道如何确保页面符合html5 / css3。 我也在寻找像firebug这样的插件,它将帮助我的团队确保我们遵循最佳实践,同时为财富500强客户的基于Web的应用程序构建高质量的前端。

如果我可以获得一个插件或任何链接到基于Web的开源应用程序将是伟大的!


We are building web based application front end for a web based application using HTML5/CSS3/JQUERY. We are using firebug at the moment which is not helping us good. I would like to know how can i ensure the pages are html5/css3 compliant. I am also looking for a plugin like firebug, which will help my team to make sure we are following best practices and while building quality front end for web based application for fortune 500 client.

If i could get a plugin or any link to web based open source application will be great!


原文:
更新时间:2022-12-19 12:12

最满意答案

从我所看到的,您正在尝试将元素插入到通过iFrame嵌入的文档中。 但你不能这么简单。 问题是,当您从父(而不是iframe)窗口调用document.getElementById时,它会尝试在父窗口中查找元素。 但是iFrame是一个单独的窗口。

你可以尝试以下。

在每个特定的游戏html文件中:

<body>
  <!-- SOME CONTENT HERE -->

  <!-- RIGHT BEFORE `BODY` CLOSE -->
  <script>
    // This will run your code once document is loaded.
    window.onload = function () {
        // run the createName function
        createName();
        // run the createList function 
        createList();
        //play game
        playGame(target);
    };
  </script>
</body>

learningGames.js中

function populateSpellList() {  

    // for loop should run through spelling list array and create list items in "listSpelling"
    var i;
    for (i = 0; i < spellingList.length; i++ ) {

        var newLI = document.createElement("li"), // create a new li
            displaySpellList = document.getElementById("listSpelling"), // cache the unordered list
            newContent = document.createTextNode(spellingList[i]); // grab the spelling list item

        // add the spelling list item to the li
        newLI.appendChild(newContent);

        displaySpellList.appendChild(newLI);
    }
}

function gameWindow(target) {
    // set the iframe html to the target html 
    document.getElementById('game_frame').src = target;
}

希望它正是您所需要的。


From what I can see, you're trying to insert elements into the document which is embeded via iFrame. But you can't do this that simple. The thing is that when you call document.getElementById from the parent (not iframe) window, it tries to find an element within parent window. But iFrame is a separate window.

You can try following.

In every specific game html file:

<body>
  <!-- SOME CONTENT HERE -->

  <!-- RIGHT BEFORE `BODY` CLOSE -->
  <script>
    // This will run your code once document is loaded.
    window.onload = function () {
        // run the createName function
        createName();
        // run the createList function 
        createList();
        //play game
        playGame(target);
    };
  </script>
</body>

In learningGames.js:

function populateSpellList() {  

    // for loop should run through spelling list array and create list items in "listSpelling"
    var i;
    for (i = 0; i < spellingList.length; i++ ) {

        var newLI = document.createElement("li"), // create a new li
            displaySpellList = document.getElementById("listSpelling"), // cache the unordered list
            newContent = document.createTextNode(spellingList[i]); // grab the spelling list item

        // add the spelling list item to the li
        newLI.appendChild(newContent);

        displaySpellList.appendChild(newLI);
    }
}

function gameWindow(target) {
    // set the iframe html to the target html 
    document.getElementById('game_frame').src = target;
}

Hope it is exactly what you need.

相关问答

更多
  • 你可以使用wrapAll() 使用each()迭代所有div 使用children()获取所有li里面 用wrapAll()用ul包装它 $('.someclass').each(function() { $(this).children('li').wrapAll($('
      ', { class: 'ajax-terms' })); });