/    Sign up×
Community /Pin to ProfileBookmark

How can I grab text from another site on the fly?

I am trying to develop a system where if a user hovers over a particular link, a little tool-tip box (just a div) will show up, show a ‘thinking’ graphic if need be, and grab a specific chunk of text from our wiki. I’ve got the text in the wiki in a unique wrapper, I just don’t know how to execute the actual grabbing process. Is this possible with j/s? What else should I look into from here?

to post a comment
JavaScript

10 Comments(s)

Copy linkTweet thisAlerts:
@phpnoviceMay 31.2006 — Don't know what wiki is, but you'll need a DHTML Tooltip Popup script and perhaps you're looking for [B]Ajax[/B] to retrieve the information from the server?

http://jibbering.com/2002/4/httprequest.html
Copy linkTweet thisAlerts:
@UltimaterMay 31.2006 — Wiki is an online encyclopedia:

http://en.wikipedia.org/wiki/Main_Page

Since Wiki is an external website and JavaScript is very limited, requesting a page from wikipedia.org would cause a cross-domain permission denied security error within your own personal domain. Ajax is supposed to only be used for requesting pages within the same domain. Read up on the work arounds available for cross-domain http requests:

http://www.xml.com/pub/a/2005/11/09/fixing-ajax-xmlhttprequest-considered-harmful.html

I’d personally use PHP or an Apache Proxy (page 2 in the above link).
Copy linkTweet thisAlerts:
@phpnoviceMay 31.2006 — Wiki is an online encyclopedia:

http://en.wikipedia.org/wiki/Main_Page

Since Wiki is an external website ...[/QUOTE]

I know what WikiPedia is, but are you sure that is what the OP is talking about? The OP said:
...grab a specific chunk of text from [COLOR=Red][B]our[/B][/COLOR] wiki...[/QUOTE]
Copy linkTweet thisAlerts:
@UltimaterMay 31.2006 — Nope, I'm not sure if he is talking about wikipedia.org or not. Now that you bring it to my attention, I admit I'm probably wrong in regard to that. However I do know he's working with an external domain as it is mentioned in the thread title so therefore the rest of my post should still be of some additional guidance on top of your initial post.
Copy linkTweet thisAlerts:
@phpnoviceMay 31.2006 — True, but are the following considered cross-domain? ...or, not?

www.domain.com

wiki.domain.com

Two sites -- one domain, yes?
Copy linkTweet thisAlerts:
@UltimaterMay 31.2006 — Two subdomains would encounter a permission denied security error. "Two sites" is a better way to word it. Should I call it a cross-[i][color=blue]site[/color][/i] permission denied security error in the future? It sounds funny but defiantly more accurate ?
Copy linkTweet thisAlerts:
@phpnoviceMay 31.2006 — OK, so you're saying that it is not really a cross-domain security restriction.

Instead, it is a cross-server security restriction.
Copy linkTweet thisAlerts:
@UltimaterMay 31.2006 — That is correct. Ok, I'll call it a "cross-server permission denied security error" in the future.
Copy linkTweet thisAlerts:
@ericdfieldsauthorJun 01.2006 — Wow... an abundance of information. Thanks a lot.

For the record, this would be happening within the same domain. I want my site at xyz.com to pull info from wiki.xyz.com.

In my own research, i found that wiki's do not identify paragraphs or sections in any particular way, so i think i'd also have to wrap the text i want to grab in an id'd div.
Copy linkTweet thisAlerts:
@phpnoviceJun 01.2006 — For the record, this would be happening within the same domain. I want my site at xyz.com to pull info from wiki.xyz.com.[/QUOTE]
Ya, but that is part of the question. ?
True, but are the following considered cross-domain? ...or, not?

www.domain.com

wiki.domain.com

Two sites -- one domain, yes?[/QUOTE]
×

Success!

Help @ericdfields 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 5.26,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...