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

137
Visualizações
Building an web app to run inside other apps through a JS code-snippet

I was given the task to develop sliders/pop-ups for customers of the company I work for. This works a bit like chatbots (ie. Intercom). The user sees a small bubble on the bottom-right corner, clicks on it and it shows some information from our (Rails) app.

What's the best way to create a javascript code to share with those clients? Should I add my code to a public js file and send those clients a script targeting my app? (like the example below?)

<script src='https://www.myapp.com/script.js'></script>

I've tried to do so, but it looks like the script doesn't link to my CSS files, so styles are broken. So I am not sure if it's the best way to go.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You're using the right approach.

To fix your missing CSS you could adjust your script to add the required CSS references to the head of the page.

let externalCssLink = document.createElement('link')
externalCssLink.rel = 'stylesheet'
externalCssLink.href = 'https://some-external-domain.com/some-css.css'

document.head.appendChild(externalCssLink)
about 4 years ago · Juan Pablo Isaza Relatório
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