subir precarga multiples mostrar example drop con como bootstrap archivos and jquery

jquery - precarga - subir archivos javascript



jquery adjuntar archivo html externo en mi página (4)

Estoy intentando agregar un contenido html externo (div más un poco de texto dentro solo para probar) de esta manera:

$.get("banner.html", function(data){ $(this).children("div:first").append(data); });

Eso parece ser bastante simple ... pero no parece funcionar. ¿Alguna idea? ¡Gracias!


No estoy seguro de a qué se refiere esto en su ejemplo ... aquí hay un método alternativo:

<html> <head> <script src="http://code.jquery.com/jquery-1.6.4.min.js" type="text/javascript"></script> <script type="text/javascript"> $(function () { $.get("banner.html", function (data) { $("#appendToThis").append(data); }); }); </script> </head> <body> <div id="appendToThis"></div> </body> </html>


Puedes usar la función de carga de jquery aquí.

$("#your_element_id").load("file_name.html");

Si necesita más información, aquí está el enlace .


Use html en lugar de adjuntar:

$.get("banner.html", function(data){ $(this).children("div:first").html(data); });


<html> <head> <script src="http://code.jquery.com/jquery-1.6.4.min.js" type="text/javascript"></script> <script type="text/javascript"> $(function () { $.get("banner.html", function (data) { $("#appendToThis").append(data); }); }); </script> </head> <body> <div id="appendToThis"></div> </body> </html>