Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Load an HTML document in JavaScript
Old 11-02-2007, 07:52 PM Load an HTML document in JavaScript
aatiis's Avatar
Skilled Talker

Posts: 53
Name: Attila Oláh
Location: Serbia
Trades: 0
I need to crawl information from other sites, dynamically.
Code:
d = new Document();
throws this exception:
Code:
Error: uncaught exception: [Exception... "Object cannot be created in this context"  code: "9" nsresult: "0x80530009 (NS_ERROR_DOM_NOT_SUPPORTED_ERR)"  location: "file:///home/aatiis/path/to/file/example.html Line: 9"]
Of course, I could use iframes, but then the browser loads the complete page, with scripts, styles, images, plugins, etc... I only need the data in that html. How do I get it using as little bandwidth as possible?
__________________

Please login or register to view this content. Registration is FREE
:: my web design blog
aatiis is offline
Reply With Quote
View Public Profile Visit aatiis's homepage!
 
 
Register now for full access!
Old 11-02-2007, 07:59 PM Re: Load an HTML document in JavaScript
Defies a Status

Posts: 3,420
Trades: 0
Can you just confirm that nothing underhand is taking place here - i.e. stealing someone else's content or something?
CSS4Life is offline
Reply With Quote
View Public Profile
 
Old 11-03-2007, 07:05 AM Re: Load an HTML document in JavaScript
aatiis's Avatar
Skilled Talker

Posts: 53
Name: Attila Oláh
Location: Serbia
Trades: 0
Actually I'm glad you asked. I'd like to use someone else's search results. It's not Google, so there's no API available. If I put on my page that I use eg. Yahoo's or Google's search results, is it ok? Or need I ask the mentioned company? I thought the search results are not copyrighted, as there are other "parasite" search engines on the internet. If I'm wrong, please show me where could I read more about this matter?

Thank you for warning me anyway.
__________________

Please login or register to view this content. Registration is FREE
:: my web design blog
aatiis is offline
Reply With Quote
View Public Profile Visit aatiis's homepage!
 
Old 11-03-2007, 08:13 AM Re: Load an HTML document in JavaScript
Defies a Status

Posts: 3,420
Trades: 0
If you are planning on earning anything from this site or getting a large number of visitors, it would be a very bad idea not to ask the company themselves.

I'm not a Javascript developer so I can't answer your original question, but I'm sure there would be someone here who could.

Hope this helps,
Dan
CSS4Life is offline
Reply With Quote
View Public Profile
 
Old 11-03-2007, 09:22 AM Re: Load an HTML document in JavaScript
aatiis's Avatar
Skilled Talker

Posts: 53
Name: Attila Oláh
Location: Serbia
Trades: 0
Thank you for your help, Dan. Right now I'm trying to solve the problem whit a cute little javascript library called jQuery. I'm not planning to earn big bucks, just coding around... But if my site ever gets more than 10 visitors a week, I'll consult the companies. Basically, I think it's a bad idea to crawl data from search engines, strip out their ads and place my own ads on the site. It sounds like stealing for me. Anyway, If I manage to do something useful, I'll consult someone before publishing anything.
__________________

Please login or register to view this content. Registration is FREE
:: my web design blog
aatiis is offline
Reply With Quote
View Public Profile Visit aatiis's homepage!
 
Old 11-03-2007, 07:51 PM Re: Load an HTML document in JavaScript
Extreme Talker

Posts: 238
Location: United States
Trades: 0
I'm fairly sure that this (opening files on remote servers) is not allowed in JavaScript due to odd security reasons... You could load a JavaScript file from a remote server through HTML (e.g., <script src="http://example.com/js.js...). This is how Google's AJAX search API works- their JavaScript is hosted on their server, so they are able to use the AJAX on their own servers.

The only ways I know of to load files like this is through tags like <script> or <iframe> like you mentioned. You would have much more flexibility using a server-side language like PHP, or perhaps PHP in conjunction with AJAX.
__________________
The interlocking pieces of web development: usability, performance, accessibility, and standards.
frost is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Load an HTML document in JavaScript
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.65470 seconds with 12 queries