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

153
Visualizações
Emoji keyboard online for browser

I wrote an emoji keyboard online (maybe called it emoji picker, emoji selector) at https://www.emojionline.org. Everything works ok, but there is one problem for memory optimization. My data is stored in an json file. It has 2000 records (size 600kb). I use ajax to load it into memory:

function loadData(){
json = (function () {
json = null;
$.ajax({
    'async': false,
    'global': false,
    'url': 'data.json',
    'dataType': "json",
    'success': function (data) {
        json = data;
    }
});
return json;
})(); 

} And on ready event of document, I called it.

$(document).read(function(e){var data = loadData();});

Everything works well on PC, Mac and smartphone with high RAM (>=GB). For weaker devices, I feel it works bad. Sometime, if the connection is low, I got the message ".... the page need to be reloaded". I understand that to hold a big json file in memory is not good processing. But I need this data for processing. What can I do to do in this situation? I just use jquery, js, html, css. No dynamic languages for web, such as PHP, Java... in this situation are recommended.

I found the solution, but I don't know this is good or not. For me, it really reduce time loading. The solution is: embbed the data into html file. Use external files always make more requests and reduce performance.

over 4 years ago · Santiago Trujillo
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