Solved

open url inside of .js

Posted on 2015-02-20
4
51 Views
Last Modified: 2015-03-12
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
Comment
Question by:ITsolutionWizard
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 40621998
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
 
LVL 33

Accepted Solution

by:
Big Monty earned 500 total points
ID: 40622092
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
 
LVL 1

Author Comment

by:ITsolutionWizard
ID: 40622509
no. both responses do not help. I need the way I asked. Let me know if you know how to do it.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 40622525
AJAX is the only way that javascript can get data from a web site.
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
This video teaches viewers about errors in exception handling.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question