FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

JavaScript (HTML DOM) on Extern sites.

 


Gushe
Hello all.

I was just wondering; is there a way to for example Return href from an extern website using JavaScript (if you know the ID of course) with:
Code:
document.getElementById("style1").href

but than from an extern Web-Page. Smile

So I can use the HTML DOM for extern Websites? (off course I know it happens only on my PC since JavaScript is Client-Side.)

Thanx in Advance;
~ GuShe.
alalex
Well Javascript can for sure get XML from other sites, that would just be normal AJAX stuff, but select stuff from an external site with the getElementByID() call I'm not sure, although my first guess is that it is not possible...
Try this link:
http://www.daniweb.com/forums/thread96626.html

And then browse this results in google...
Gushe
Well.. I found a way to do it in JavaScript:

Making an Invisible Iframe that loads the Page and than Acces the Iframe; since that should be possible. Smile

Now the problem is; Using JavaScript; probably everybody will know which 'n00bie-looking' way I'm using to retrieve info from certain websites.
So would there be a way doing this in PHP? Or letting the JavaScript run from an external file (Like PHP files; you don't really see the files)?

PHP would be prefered as I could make one big script for everything I need to do with the retrieved info. Smile


Thanx in Advance;
~ GuShe.
alalex
Of course it is much better to use php, since JavaScript might be disabled by some users.

With php I recommend you use cURL, you can search for tutorials on google. There is also fgets and other functions for this, but curl is just easier I guess
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.