Solved

Load URL contents into a variable

Posted on 2012-03-21
3
415 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
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
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 …
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

679 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