By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,516 Members | 1,126 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,516 IT Pros & Developers. It's quick & easy.

get html source from a url

P: n/a
If I know a URL, say, www.javascript.com, how can I get the html source
using javascript function/method? Thanks.

__________________________________________________ _______________
High-speed Internet access as low as $29.95/month (depending on the local
service providers in your area). Click here. https://broadband.msn.com

Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Ivo
"Song Zhang" <so****@hotmail.com> wrote in message
news:BA*************************@hotmail.com...
If I know a URL, say, www.javascript.com, how can I get the html source
using javascript function/method? Thanks.


Cross-domain scripting restrictions apply. In other words, javascript cannot
do it. Browsers are designed to that way, for obvious security reasons.
Workarounds include serverside script and ActiveX stuff. For more
information, you can start at www.jibbering.com/faq/#FAQ4_19.
Ivo.
Jul 20 '05 #2

P: n/a
VK
Within your own domain under IE you can use frames with document.domain
property PROGRAMMICALLY set to the same value in both frames. After that you
can use innerHTML and textRange objects between frames. But under your own
domain you have easier ways to accomplish your tasks.

With cross-domain it's not possible using JavaScript. With server-side
scripting it's technically not so difficult, but it's called
"content/traffic stealing", and shame on thieves!
Song Zhang <so****@hotmail.com> wrote in message
news:BA*************************@hotmail.com...
If I know a URL, say, www.javascript.com, how can I get the html source
using javascript function/method? Thanks.

__________________________________________________ _______________
High-speed Internet access as low as $29.95/month (depending on the local
service providers in your area). Click here. https://broadband.msn.com

Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.