Skip to content

multiple jsonp requests on same page failing with timeout error #31

Open

Description

@mandard24

Hi,

I'm doing multiple jsonp calls from one page to get a set of images for each of the product that will be rendered on the page. Even though I see all the requests return response(status - 200) for each of the jsonp call, I'm only able to get the data for one product only(mostly its the last product on the page).

IMPORTANT: all the jsonp requests uses same callbackto return the content.

I'm using React component to render product list by iterating through an array. Every time a new product list component is called/created, i make the jsonp request to fetch the set of images and display on the page.

When my page renders I see only one of the product shows the list of images. And rest of the jsonp request end up in 'Timeout' error.

Can someone show me how to make these multiple jsonp requests each with the same jsonp callback that simply gets content for each of the product?
console-error
network-requests-success

Activity

  1. alliuca commented on Oct 12, 2017

    @alliuca

    can you change the callback prefix on each request? that's how I solved my issue. Something like:

    jsonp(${url}&callback=${cbPrefix}, { timeout: 1000, prefix: cbPrefix }, (err, data) => {

    that cbPrefix is different at each request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions