It's a security breach.  Script in one window/frame can't access properties of a separate window/frame if the domain's are different.  Use this script to see what I mean:
 
      var newWindow = window.open("", "testWindow", "width=300,height=300");
      newWindow.opener = self;
      alert(newWindow.document.location);
      newWindow.document.location = "http://imdb.com";
      alert("Wait til page loads...");
      alert(newWindow.document.location);
Initially the window has the local computer's domain, and you can access the property just fine.  Once you change the domain by setting the document.location, you'll get an access denied error if you try to read the property you just set.
 
----- Original Message -----
Sent: Wednesday, March 17, 2004 10:35 AM
Subject: Re: [DQSD-Users] how do I access document properties

kn, you have to call something like           
 
var xmlHttp = new ActiveXObject("Microsoft.XmlHttp");
xmlHttp.open("GET", sUrl, false);
xmlHttp.send();
//get the response content from the remote site
 var sBody = xmlHttp.responseText;
 
then parse the results of the request...
 
 
I do this exact thing in comx.xml..  
 
 
Monty

  
 
----- Original Message -----
From: k n
Sent: Thursday, March 11, 2004 10:20 PM
Subject: [DQSD-Users] how do I access document properties

Hi all
 
I'm trying to capture some information in a document opened by dqsd, such as the location.href or title of a web page, I always get "access denied" error.  Am I doing soemthing wrong here?  I really appreciate your help.
 
here's my test script:
 
<search function="test">
  <name>test</name>
  <category></category>
  <contributor>tester</contributor>
  <link>http://imdb.com/</link>
  <email></email>
  <description>
  </description>
  <script><![CDATA[
    function test(q)
    {
 var newWindow = window.open("http://imdb.com");
 var n = newWindow.document.location;
 alert(n);
    }
  ]]></script>
  <copyright>
 Copyright (c) 2002 David Bau
 Distributed under the terms of the
 GNU Public License, Version 2 (http://www.gnu.org/copyleft/gpl.txt)
  </copyright>
</search>
 


Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster.

Reply via email to