473,399 Members | 3,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

[JS]can't change top's title

1
Hello, i have strange problem. I've simple page with frameset on freeDNS serwer (don't have access to change anything) and the page on mine server. I want to change the title of browser's bar
Expand|Select|Wrap|Line Numbers
  1. self.parent.document.title = 'my own title';
  2. //or
  3. top.document.title = 'my own title';
  4.  
without result. What suprised me a lot, when i put code for "escaping from frame"
Expand|Select|Wrap|Line Numbers
  1. function changePage()
  2. {
  3.   if (self.parent.frames.length != 0)
  4.   {
  5.       alert("beware! You are in frame!");
  6. //        alert(self.parent.location);
  7.         self.parent.location=document.location;
  8.   }
  9. }
  10. setTimeout ("changePage()", 2000);
  11.  
it works fine. But when I remove comment "//" from in front of alert(self...) I get an error.

I tested this code on IE6 and FF2.04

Ps. It works when the page in frameset is a local file
Sep 25 '07 #1
1 1834
acoder
16,027 Expert Mod 8TB
Welcome to TSDN!

This problem occurs because Javascript does not allow cross-domain scripting for security reasons.
Sep 25 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: juglesh | last post by:
hi, I'm just getting started here in php, but i've been able to get some basic variable stuff working, so I'm just looking for advice on the basic set up of some thumbnail->picture pages. the...
2
by: KS | last post by:
I have a folder where i got all my external javascript.js files saved. Using the external.js files in my .jsp files works fin by: <script language="JavaScript"...
7
by: drum118 | last post by:
What is the current way for stating what a java script TITLE is for xhtml strict since I must be over looking it? W3 validation said there is no title. When I wrote the site 5 years ago to...
8
by: Henri | last post by:
Hi, Is there a way to include a .js file inside a .js file in JavaScript 1.5? Thanx Henri
13
by: nobody | last post by:
Hello all, I've searched just about everything and although I can see that other people are having problems, but theirs don't seem to relate, so in a last ditch attempt, my posting! Script...
55
by: drhowarddrfine | last post by:
I'm working on a web site that could use some control using js but am concerned about what problems I may have with potential users having their js turned off. Has anyone had any serious problems...
7
by: mark4asp | last post by:
How can I prevent Caching of JavaScript and CSS files ONLY when I deploy a new application? I only want to force a refresh the first time the client uses the new build. For instance, I'm told I...
5
by: maheswaran | last post by:
Hi, I have did one javascript top menu (drop down menu).. While first time displaying the drop down list comes little down from menu list (with cap)...After refreshing that page it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.