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

157
Visualizações
How to redirect to a view after a button click?

I have a some social sharing links in my HTML template. I can share to Facebook, LinkedIn, Twitter and Whatsapp, but I want to redirect to a URL (views) in Django that would give 100 points to the user that is sharing the post using the social share link.

How can I asynchronously redirect to that view in the background?

I have tried this, but it doesn't seem to work

<div class="fb-share-button" data-href="{{url_string}}" data-layout="button_count" onclick="window.open({% url 'core:social-share' %},'_blank'); return false;"></div>

These are my shareable links#

<a href="https://www.linkedin.com/shareArticle?mini=true&amp;url=https://youtube.com/user/desphixs/&amp;title=WelcomeTo{{company.name}}&amp;summary={{company.name}}&amp;source=mywebsite" target="_blank" rel="noopener">
  <small>Share on Linkedin</small>
</a>

<a class="share-linkedin text-white mr-2" href="whatsapp://send?text={{content_string}}{{url_string}}" data-action="share/whatsapp/share" target="_blank" rel="noopener">
  <small>Share on Whatsapp</small>
</a>
about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I do not know whether there is a way to reliably check whether a user actually shared content or just clicked your link and did nothing.

But you could send a POST to a Django endpoint which adds the 100 pts to user's points, which answers with an HTTP303 to redirect the user to another page.

A clientside solution would look the same:

  1. Send a POST to any endpoint
  2. location.href to redirect.
about 4 years ago · Santiago Trujillo 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