• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 61
  • Last Modified:

open url inside of .js

I have abc.js and I want to call webservice inside of .js

like I want to call web services  '../RestService/QuoteService/GetModelList(066,315217)';

and so it will return data inside of the abc.js.

Is it possible?
0
ITsolutionWizard
Asked:
ITsolutionWizard
  • 2
1 Solution
 
Dave BaldwinFixer of ProblemsCommented:
You can use AJAX to return the data to a variable.   http://www.w3schools.com/ajax/default.asp  Most examples show returning the data to a 'div' or some other HTML element but a variable will work just as well.
0
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
if possible, use jquery's built-in ajax function, it'll be a lot easier to use:

$.ajax({
  url: '../RestService/QuoteService/GetModelList(066,315217)'
}).done(function( theResponse ) {
  var yourVariable = theResponse
});

Open in new window

0
 
ITsolutionWizardAuthor Commented:
no. both responses do not help. I need the way I asked. Let me know if you know how to do it.
0
 
Dave BaldwinFixer of ProblemsCommented:
AJAX is the only way that javascript can get data from a web site.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now