0

我的HTML样子

    <div class="queue_list">
        <div class="queue_item hide-item">
            <img class="thumbnail" />
            <p class="title"></p>
        </div>
    </div>

我的jQuery功能看起来像

$(function(){
    $('#queue').click(function(){
        $("#feature").load("templates/queue.html");
        var template = $('.queue_item').clone();
        if (localStorage['test'] == null ) {
            $('.queue_list').append(<p>You have not added any video to the queue yet</p>);
        } else {
            queue_list = JSON.parse(localStorage['queue']);
            for (var i = 0; i < queue_list.length; i++) {
                console.log(queue_list[i]);
            }
        }
    });

当我在 中进行测试时Firefox,我看到异常为

message "Could not convert JavaScript argument arg 0 [nsIDOMDocumentFragment.appendChild]"
name    "NS_ERROR_XPC_BAD_CONVERT_JS"
result  2153185289
__proto__   [unsupported: no toString() function in type object] { QueryInterface=QueryInterface(), initialize=initialize()}

localStorage['test']是空的

我在这里做错了什么?

4

0 回答 0