Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7835965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:53:57+00:00 2026-06-02T13:53:57+00:00

Im trying to figure out a way to get some JSON data transfered from

  • 0

Im trying to figure out a way to get some JSON data transfered from my server to the client, and then evaluated clientside using javascript.

Right now i do this with a simple XHR call that retries a JSON string. This works fine, but the problem is that its blocking.

What i want to do is to start downloading my .js file using on-demand javascript loading like:

  var head = document.getElementsByTagName("head")[0];
   script = document.createElement('script');
   script.id = 'myScript';
   script.type = 'text/javascript';
   script.src = "myScript.js";
   head.appendChild(script);

This works fine and is not blocking the rest of the page from loading.

Then in “myScript.js” i have an onload function, that will be triggerd when page is done loading. In this function there are a call to the server that retrieves the JSON string.

Problem is that as it is an onload function, it will not start retrieving this JSON until the page is done loading.

So im looking for a way to start downloading the JSON string before onload event is triggered, but WITHOUT blocking the page from loading.

And my idea was that i wanted to save the data into a gif serverside, and start downloading this as part of the page, and then on onLoad i will trigger my function and convert the gif into JSON using javascript.

Hope it make sense!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T13:53:58+00:00Added an answer on June 2, 2026 at 1:53 pm

    You can load a PNG file and read it via javascript and the HTML5 canvas object. The gist is to draw the image onto a canvas element; then read it via Javascript after it’s drawn. Here’s code (https://github.com/ijoey/datainimage) from my research, it serializes a JSON object into a string, stores that data into an array and draws it onto a canvas element. Then, it reads it back.

    Here’s a link to my code on Github: https://github.com/ijoey/datainimage/

    I started off with the following article about how to do it:
    http://blog.nihilogic.dk/2008/05/compression-using-canvas-and-png.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to figure out how to get all the string values from some
I'm trying to figure out a way to use tar+pipes on a Ubuntu Server
I'm trying to figure out a way to serialize some Django model object to
I'm trying to figure out a way to pass the entire class from my
I have been trying to figure out a way to tag several methods from
I'm trying to figure out the best way to get everything before the -
I'm still trying to figure out a way to get a mobile site running.
I'm trying to figure out if there's a way to get the progress of
I'm trying to figure out a way to stop this flash message from showing
I am trying to figure out a way to pre-process few things before my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.