Solved

Load URL contents into a variable

Posted on 2012-03-21
3
416 Views
Last Modified: 2012-04-12
I am looking for a way in javascript/jquery to load the contents of a URL into a variable.
0
Comment
Question by:Blowfelt82
[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
3 Comments
 
LVL 40

Accepted Solution

by:
gurvinder372 earned 500 total points
ID: 37748322
use load() method to get the content of a URL into a div, and then you can take it from that div
http://api.jquery.com/load/

also check get() method's success event
http://api.jquery.com/jQuery.get/
0
 

Author Comment

by:Blowfelt82
ID: 37748363
Ok this looks promising, as far as you know would this work for external websites outside of my own domain?
0
 
LVL 40

Expert Comment

by:gurvinder372
ID: 37748477
Nope, only for the same domain....for external domain, you need to get the content from your server side script
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

734 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