miguel-perez/smoothState.js

storePageIn() fails to find container in new doc if nested

Open

#193 创建于 2015年7月8日

在 GitHub 查看
 (8 评论) (0 反应) (0 负责人)CSS (4,433 star) (515 fork)batch import
bughelp wanted

描述

Nesting the container even one level under the body tag prevents storePageIn() from find it.

<body>
    <div>
        <article id="js-smoothstate-content">
            <h1>TEST CONTENT</h1>
        </article>
    </div>
</body>

The filter() function won't find the container id (Chrome v43):

storePageIn: function (object, url, doc, id) {
    /../
    object[url] = { // Content is indexed by the url
        /../
        html: $newDoc.filter('#' + id), // Stores the contents of the page
    }; 
}

Consider using .find() instead?

贡献者指南

storePageIn() fails to find container in new doc if nested · miguel-perez/smoothState.js#193 | Good First Issue