0

これは疲れます。ある要素から別の要素への単純な追加を試みています:

            var contentBlob = $('<div></div>', {
                "id"    : "content-blob",
                "css"   : {
                    "display" : "none",
                    "color" : "red"
                    }
            });

            // this guy gets a full xhtml page with head and body.  
            // I don't want to use load()
            model.getHtml(indexUrl, function(response){
                    if(response != 0){
                        contentBlob.html(response);
                    }
            });

            contentBlob.appendTo('body');
            //I've verified the that the contentBlob (#content-blob) is in the body

            // This should be super simple.  No matter what I do, Its not appending 
            // the ul.
            $('#content-blob > ul').appendTo('#contents-index-actual-index');

セレクターをトリプルチェックしましたが、すべてが合法に見えます。興味深い点の 1 つは、セレクターに ul を追加しないと #content-blob が追加されることです。

4

1 に答える 1

0

斜視は正しかった。appendTo の後に async get が発生していました。

于 2013-05-03T17:21:28.153 に答える