jquery load issue

后端 未结 2 1696
日久生厌
日久生厌 2020-12-09 23:30

I\'m loading pages asynchronously with the jQuery load function, like this:

tree.click(function() {
                if ($(this).hasClass(\"file\")) {
                


        
2条回答
  •  爱一瞬间的悲伤
    2020-12-10 00:03

    You need to call that in the callback to load:

      content.load("content/"+this.id+".html",function() {
         SyntaxHighlighter.all();
      });
    

    load is asynchronous so it happily continues along executing statements while the GET request is done in the background.

提交回复
热议问题