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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:42:34+00:00 2026-06-05T04:42:34+00:00

I have spent days working on this and really feel dumb. I have been

  • 0

I have spent days working on this and really feel dumb. I have been working on demos and samples that never work when I try it locally with my own url. I have a web service that returns results back in json and am just basically trying to call it using dojo and for now just view the results. I took the search google example and just substituted the url and parameters. Now perhaps I still do not understand the basics so:
– io.script.get vs xhrGet
if using cross domain urls it is better to use io.script.get? correct?
now what is the callbackparam? is this the function that is being called in the webservice?
My webservice url is as follows:
http://xxx.xxx.x.xxx/WcfServices/WcfInstance/Service1.svc/RetrievData?query=Word

when I use the following code I get nothing displayed.

function searchGoogle() {
    // Look up the node we'll stick the text under.
    var targetNode = dojo.byId("rules");

    // The parameters to pass to xhrGet, the url, how to handle it, and the callbacks.
    var jsonpArgs = {
        url: "http://xxx.xxx.x.xxx/WcfServices/WcfInstance/Service1.svc/RetrieveData?",
        callbackParamName: "callback",
        content: {

            query:"dojowords"
        },
        load: function (data) {
            // Set the data from the search into the viewbox in nicely formatted JSON
            targetNode.innerHTML = "<pre>" + dojo.toJson(data, true) + "</pre>";
        },
        error: function (error) {
            targetNode.innerHTML = "An unexpected error occurred: " + error;
        }
    };
    dojo.io.script.get(jsonpArgs);
}
dojo.ready(searchGoogle);

Here is what the webservice results look like:

"{\"rules\":[{\"value\":\"AllState\"},
 {\"value\":\"Cidade de Goa beach\"},{\"value\":\"Euro 2012\"},     
 {\"value\":\"Euro2012\"},{\"value\":\"European&Championship\"},
 {\"value\":\"Holiday  Inn Resort\"},
 {\"value\":\"Holiday Inn Resort goa\"},
 {\"value\":\"Hotel Goa\"},{\"value\":\"Hyatt Goa\"},{\"value\":\"I buy car\"},...

If I get this part correct then at least I know I have data which I can then bind to a datagrid or chart.

  • 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-05T04:42:36+00:00Added an answer on June 5, 2026 at 4:42 am

    dojo.io.script.get is for all cross domain requests.
    xhrGet is for same domain requests.

    dojo.io.script.get uses a hack which expects jsonp or json padding as a result. This wraps the response of the web service call inside a self executing function. The function name is the callback name. This has to be wired before the call so it knows what already defined function to call when a response comes back.

    All of the arguments are well documented http://dojotoolkit.org/reference-guide/1.7/dojo/io/script.html

    My guess as to why your service isn’t working is because you wrote the web service and it does not handle jsonp. It is not wrapping its response inside the callbackparamname.

    your results should look something like

     callback({json});
    

    where callback is whatever you set up in callbackParamName

    you can also remove the ? from your url, that should be handled for you.

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

Sidebar

Related Questions

I have spent the past couple of days working on this and am going
I have spent the past 2 days wondering why this is not working, but
I have spent last 3 days until I got gps working on android using
I have spent days trying to figure this out to no avail. I have
This case is really strange, i've spent 2 whole days to get Twitter Oauth
I have spent 4 days with this one issue and have search countless of
Possible Duplicate: Send NSString via Game Center i have been working on this for
I have been searching the internet for days trying to solve this problem. I
So, I've been trying to get this page working for a couple of days
I have been working now for few days on a small C program which

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.