Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

182
Vistas
How to properly pass values through in jquery / ajax calls

I've been creating a web app and one example of something it does is create golf rounds. Everything I've done works but I have been doing some testing and the way im passing variables through to my ajax call means the user could update anyone's round.

Currently I have a table that shows you your round and you can select the view button which will open a modal form to show details of that round.

This is my HTML

<button
  type="button"
  id="view-round"
  class="btn btn-outline-primary btn-square btn-skew pull-right" 
  attr-id="39"
>View</button>

This is my jquery

$('body').on('click', '#view-round', function () {
    var id = $(this).attr('attr-id');
    $.post('/dashboard/pages/golf/round/ajax.php?action=load', {id: id}, function(response) {
      //code in here
    }
   });

You can see from this that I'm passing through the round id via the attribute on the button "attr-id".

What I'm asking is can I put this variable somewhere someone couldn't edit it via the developer console etc.

I'm currently changing the ajax calls so that you can only update/look at your own records but really I'd like to stop it from being changed all together.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda