/    Sign up×
Community /Pin to ProfileBookmark

save Foreign URL content in String, how?

Hi, I’m newbie.
I want to save an foreign url source code in a string and further search trought this string for specific words. Is it possible?

it works with google apps script like so:
var response = UrlFetchApp.fetch(“http://www.google.com/“);
Browser.msgBox(response.getContentText());

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@WolfShadeMar 14.2011 — I just recently learned (the hard way) that although you can get a web document source inserted into a string, cross-domain security prevents it (it could be used for stealing content) in JavaScript. It can be done using a server-side language like CF, ASP, PHP. But it's prevented in JavaScript.

^_^
Copy linkTweet thisAlerts:
@rnd_meMar 15.2011 — the the remote site supports cors (access-control headers), than any browser since IE8 can grab the code using the normal ajax routine, modified slightly with cors vocab.
×

Success!

Help @Drache spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...