HighDots Forums  

Basic question re:links.length

Javascript JavaScript language (comp.lang.javascript)


Discuss Basic question re:links.length in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Farlo
 
Posts: n/a

Default Basic question re:links.length - 09-25-2003 , 01:48 PM






document.links.length isn't working consistently in my program and I'm
not sure why.

My program opens up a web page in a new window.
(No problem so far, it works great)

Simple web pages coded by hand work fine and display the number of links
in the original window - that's my goal.

Any page off the web barfs up with zero links - if there is any output at
all.

Any ideas? Thanks all.

--
Farlo, the Urban Fey Dragon

Due to gross abuse of internet e-mail by persons unknown,
all of my e-mail is being whitelisted at the mail server.

Reply With Quote
  #2  
Old   
Lee
 
Posts: n/a

Default Re: Basic question re:links.length - 09-25-2003 , 01:57 PM






Farlo said:
Quote:
document.links.length isn't working consistently in my program and I'm
not sure why.

My program opens up a web page in a new window.
(No problem so far, it works great)

Simple web pages coded by hand work fine and display the number of links
in the original window - that's my goal.

Any page off the web barfs up with zero links - if there is any output at
all.

Any ideas? Thanks all.
That's a security feature.
A page can't read the contents of a page that doesn't
come from the same domain.
You wouldn't want a pop-behind window to be able to read
the contents of every page that you visited in another
window, would you?



Reply With Quote
  #3  
Old   
VK
 
Posts: n/a

Default Re: Basic question re:links.length - 09-25-2003 , 02:08 PM



You have no script access to pages out of your domain: security restrictions
apply.

Farlo <hall.j.m (AT) att (DOT) net> wrote

Quote:
document.links.length isn't working consistently in my program and I'm
not sure why.

My program opens up a web page in a new window.
(No problem so far, it works great)

Simple web pages coded by hand work fine and display the number of links
in the original window - that's my goal.

Any page off the web barfs up with zero links - if there is any output at
all.

Any ideas? Thanks all.

--
Farlo, the Urban Fey Dragon

Due to gross abuse of internet e-mail by persons unknown,
all of my e-mail is being whitelisted at the mail server.



Reply With Quote
  #4  
Old   
Farlo
 
Posts: n/a

Default Re: Basic question re:links.length - 09-25-2003 , 02:44 PM



Lee <REM0VElbspamtrap (AT) cox (DOT) net> wrote:

Quote:
That's a security feature.
A page can't read the contents of a page that doesn't
come from the same domain.
You wouldn't want a pop-behind window to be able to read
the contents of every page that you visited in another
window, would you?
Lee, VK, Thank you both.

Now the behavior makes sense.

--
Farlo, the Urban Fey Dragon

Due to gross abuse of internet e-mail by persons unknown,
all of my e-mail is being whitelisted at the mail server.


Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.