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

Load URL contents into a variable

I am looking for a way in javascript/jquery to load the contents of a URL into a variable.
0
Blowfelt82
Asked:
Blowfelt82
  • 2
1 Solution
 
Gurvinder Pal SinghCommented:
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
 
Blowfelt82Author Commented:
Ok this looks promising, as far as you know would this work for external websites outside of my own domain?
0
 
Gurvinder Pal SinghCommented:
Nope, only for the same domain....for external domain, you need to get the content from your server side script
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

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