Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

197
Visualizações
Displaying Div in another webpage with source scripts running

I created a webpage that is a gallery of all my products, and this page uses js to manipulate those images (change colour, change angle, etc). Each of the image is assigned div ids.

I am trying to now only embed different div into other pages on the same domain, but still allowing the js scripts to run in the embedded pages - but this doesn't seem to happen.

I've tried using these codes I've found:

    $("#mylocaldiv").load("https://mywebsite/gallery/ #divtoshow");
    <div id="mylocaldiv">
    </div>

    $.ajax({
    url:'https://mywebsite/gallery/',
    type:'GET',
    success: function(data){
    $('#mylocaldiv2').html($(data).find('#divtoshow').html());
    }
    });
    <div id="mylocaldiv2">
    </div>

Both of these are displaying correctly on the embedded page, but it doesn't seem to allow the scripts to run.

So hoping someone could at least let me know what method should I be looking into, that would allow me to embed part of a webpage into another webpage (on same domain), that also imports the scripts from the source page to the embedded page.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda