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 8955279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:30:57+00:00 2026-06-15T14:30:57+00:00

Simple question, if I have static file like this one(generated JSON using mockJSON web)

  • 0

Simple question, if I have static file like this one(generated JSON using mockJSON web)

http://www.webwrx.sk/clients/data.json.txt

What I need to do with this file to change it to JSONP? Do I need to modify it somehow? How is it different to file like api.flickr.com ?

http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any%20&format=json&jsoncallback=?

I have even added () into that file:

http://www.webwrx.sk/clients/data2.json.txt

Still following code wont work:

    var params = _.extend({
        'method': 'GET',
        'url': this.url,
        'cache': true,
        'dataType': 'jsonp',
        processData: true
    }, options);

    return $.ajax(params);

Thank you for any help.

  • 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-15T14:30:59+00:00Added an answer on June 15, 2026 at 2:30 pm

    The only difference between JSON and JSONP format is the presence of the function call in the latter.

    JSON:

    [ "foo", "bar" ]
    

    JSONP:

    callback([ "foo", "bar" ])
    

    Make sure you have a function of that name (here: callback) defined in your code, as it will be invoked:

    function callback(jsondata) {
      console.log("I got this:", jsondata)
    }
    

    jQuery abstracts the callback naming thing, so you can simply have “jsoncallback=?” in URI (assuming the server is flexible enough to know to name the function according to a parameter), and pass an anonymous function into the jQuery call. jQuery will assign the function to an autogenerated random name, then replace the question mark in your URI with that name. However, you can’t do that if you’re reading a static file (it will have a fixed function name, so it can’t change it dynamically to the autogenerated name jQuery passes it). Here is a working example with jQuery (not mine).

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

Sidebar

Related Questions

This is hopefully a simple question: I have an OpenGL texture and would like
this time i have a simple question: I have one table, related with himself
I have a very simple yes no question: should static methods have same result
simple question: I have an file online (txt). How to read it and check
Simple question: I have the following markup... <a href='#'> <img src='icon.png'> This is the
Alright simple question I have integriters like 5 188 4634 And they all need
i have a simple question: i have this var: $v = 24000,1500,1500,1500,1500,1500,; i would
I have a very simple Java code like this. I don't have any idea
I know this will look like a stupid simple question to ask but I
Let's say I have a buggy application like this: using System; namespace ConsoleApplication1 {

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.