Loading DIV content via ajax as HTML

后端 未结 3 1945
野性不改
野性不改 2020-12-12 03:51

I think I have a very simple question, but I couldn\'t find a solution. So what I want is to load a DIV content via HTML. The problem is that it is not just a text, but also

3条回答
  •  北荒
    北荒 (楼主)
    2020-12-12 04:08

    Are you looking for something like this ? https://api.jquery.com/load/

    Where you can just load HTML into a DIV using ajax. Seems to be what you're asking...

    $( "#result" ).load( "ajax/test.html" );
    

    Where your ajax/test.html file contains

    
    

    Edited... to be more specific. This is using jQuery.

提交回复
热议问题