Solved

Load URL contents into a variable

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
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…

706 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now