Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: document.domain


Message #1 by "Mike Rittelmeyer" <mike.rittelmeyer@d...> on Thu, 31 Oct 2002 14:28:14
> No but you can't change it arbitrarily. For example you can only 
change:www.microsoft.com to microsoft.com, not to linux.com.
Joe
Thanks for the response Joe. 

I have a pretty good understanding of the restrictions. Maybe I should be 
a bit more specific about the problem. The scenario is this... 

I have a JSP with doc domain set to document.domain="xxxx.com". There is 
also a clickable pop-up calendar on the JSP page with a doc domain set to 
document.domain="xxxx.com". There are several JavaScript functions that 
reside in src="/std/utils.js" (as shown in the original code context). The 
code executed when the calendar link is clicked looks like this: <a 
href="#" onMouseDown="getPosition(event, 'ibeMain', 0)" 
onMouseUp="openCalendar('standardCalendar','0')">Calendar</a></font>. The 
openCalendar() function is in the /std/utils.js file. 

The "Access is denied" message appears when the calendar link is clicked. 
Actually, it works fine in Netscape but causes an access error in IE. If 
document.domain is removed it works OK in any browser. 


>From: "Mike Rittelmeyer" <mike.rittelmeyer@d...>
>Reply-To: "javascript" <javascript@p...>
>To: "javascript" <javascript@p...>
>Subject: [javascript] document.domain
>Date: Thu, 31 Oct 2002 14:28:14
>
>I am getting an "Access is denied." javascript error when using
>document.domain= in the following context. Does
>document.domain="newdomain.com" need to be the FIRST line?
>
><html>
><head>
><title>Amtrak</title>
><script type="text/javascript" language="JavaScript"
>src="/std/utils.js"></script>
><script type="text/javascript" language="JavaScript"
>src="/std/ibeMain.js"></script>
><script type="text/javascript"
>language="JavaScript">document.domain="newdomain.com";</script>
>
></head>
>
>---
>
>Improve your web design skills with these new books from Glasshaus.
>
>Usable Web Menus
>http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
>r-20
>Constructing Accessible Web Sites
>http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
>r-20
>Practical JavaScript for the Usable Web
>http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
>r-20
>---
>Change your mail options at http://p2p.wrox.com/manager.asp or
>to unsubscribe send a blank email to 


_________________________________________________________________
Internet access plans that fit your lifestyle -- join MSN. 
http://resourcecenter.msn.com/access/plans/default.asp


  Return to Index