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

189
Vistas
Is good practice for use data params to keep json data instead of ajax call?

I used to keep my component data inside element's data param.

Is this good or i should use ajax call to retrieve data.

1. By data param:

 <a href="#" data-core="{JSON-data}" id="item-1">
 <a href="#" data-core="{JSON-data}" id="item-2">
 <a href="#" data-core="{JSON-data}" id="item-3">
 <a href="#" data-core="{JSON-data}" id="item-4">

Here, all data's are STATIC.

2. By Ajax:

 <a href="#" id="item-1">
 <a href="#" id="item-2">
 <a href="#" id="item-3">
 <a href="#" id="item-4">

jQuery: (Just example)

  $('#item-^').on('click', function()){
      // Action to Get data.
  });

Which one is good ?

[ Also here "JSON-data", might be in big in data size. ]

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The answer depends on the situation you are.

You can go for data param:

  • If all the data is not depend on the input from the user ie in simple words static
  • if you want to reduce multiple request to server.
  • It increase the responsiveness means you can deliver the content without a wait for data to load

You can go for ajax:

  • If data require some inputs or interactions from the user that is dynamic in nature.

  • If you want to load page faster ie, you can load page without loading all data initially

  • You can dynamically change the behavior or visual appearance if you prefer using ajax .
over 4 years ago · Santiago Trujillo Denunciar
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