473,409 Members | 2,034 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,409 software developers and data experts.

Frame text

Jacotheron
I need a javascript that can check if the page is in a specified frameset. If this is not true, it should disply a link to the frameset.

Can someone help me with this one please?
Jan 19 '08 #1
6 1475
Logician
210 100+
I need a javascript that can check if the page is in a specified frameset. If this is not true, it should disply a link to the frameset.
The usual practice is to return it to its correct frameset, but you need to be more specific.
Should it check that it is on a certain domain or just within any frame structure or a particular position in a frame structure?

Does it have to work locally?
Jan 20 '08 #2
The usual practice is to return it to its correct frameset, but you need to be more specific.
Should it check that it is on a certain domain or just within any frame structure or a particular position in a frame structure?

Does it have to work locally?
I know it is usualy used to return it to the correct frameset, but the program I use Adobe GoLive have that action to insert, but it is not working properly so I either need to get it working or get it to display a link to get to the correct frameset (the index.html of the site. The home page is the frameset)

Due to some restrictions on the server, I can't use some serverside scripts. That's the reason I want to use Javascript

Do you have any sugestions?

Thank you for the help so far.
Jan 21 '08 #3
I know it is usualy used to return it to the correct frameset, but the program I use Adobe GoLive have that action to insert, but it is not working properly so I either need to get it working or get it to display a link to get to the correct frameset (the index.html of the site. The home page is the frameset)

Due to some restrictions on the server, I can't use some serverside scripts. That's the reason I want to use Javascript

Do you have any sugestions?

Thank you for the help so far.
Here are the code generated by GoLive

Expand|Select|Wrap|Line Numbers
  1. CSInit = new Array;
  2. function CSScriptInit() {
  3. if(typeof(skipPage) != "undefined") { if(skipPage) return; }
  4. idxArray = new Array;
  5. for(var i=0;i<CSInit.length;i++)
  6.  idxArray[i] = i;
  7. CSAction2(CSInit, idxArray);}
  8. CSStopExecution=false;
  9. function CSAction(array) {return CSAction2(CSAct, array);}
  10. function CSAction2(fct, array) { 
  11.  var result;
  12.  for (var i=0;i<array.length;i++) {
  13.   if(CSStopExecution) return false; 
  14.   var aa = fct[array[i]];
  15.   if (aa == null) return false;
  16.   var ta = new Array;
  17.   for(var j=1;j<aa.length;j++) {
  18.    if((aa[j]!=null)&&(typeof(aa[j])=="object")&&(aa[j].length==2)){
  19.     if(aa[j][0]=="VAR"){ta[j]=CSStateArray[aa[j][1]];}
  20.     else{if(aa[j][0]=="ACT"){ta[j]=CSAction(new Array(new String(aa[j][1])));}
  21.     else ta[j]=aa[j];}
  22.    } else ta[j]=aa[j];
  23.   }   
  24.   result=aa[0](ta);
  25.  }
  26.  return result;
  27. }
  28. CSAct = new Object;
  29. function CSClickReturn () {
  30.  var bAgent = window.navigator.userAgent; 
  31.  var bAppName = window.navigator.appName;
  32.  if ((bAppName.indexOf("Explorer") >= 0) && (bAgent.indexOf("Mozilla/3") >= 0) && (bAgent.indexOf("Mac") >= 0))
  33.   return true; /* dont follow link */
  34.  else return false; /* dont follow link */
  35. }
  36. function frameP(action) {
  37.   if(parent.frames.length==0) {
  38.    var fileName=window.location.href.substring(window.location.href.lastIndexOf("/")+1,window.location.href.length);
  39.    window.location.href=action[1]+"?"+action[2]+"="+fileName;
  40.   } else {
  41.    if(top.location.search!="") {
  42.     var sFrame=top.location.search.substring(1,top.location.search.indexOf("="));
  43.     if(name==sFrame) {
  44.      var sName=top.location.search.substring(top.location.search.indexOf("=")+1,top.location.search.length);
  45.      var fileName=window.location.href.substring(window.location.href.lastIndexOf("/")+1,window.location.href.length);
  46.      if(fileName!=sName) {
  47.       location=sName;
  48.      }
  49.     }
  50.    }
  51.   }
  52.  }
  53.  
Jan 23 '08 #4
acoder
16,027 Expert Mod 8TB
You're looking to keep your page framed.
Jan 24 '08 #5
You're looking to keep your page framed.
Thank you for the help. It is working like it should.
Jan 24 '08 #6
acoder
16,027 Expert Mod 8TB
Thank you for the help. It is working like it should.
No problem. Glad you got it working.
Jan 25 '08 #7

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

Similar topics

0
by: Toph | last post by:
Bonjour a tous, Hi, I am developing a software in Python using Tkinter. The choice of my team is not to use pyton MegaWidgets. I would like to scroll a frame. This is a peace of my code : #...
1
by: Toph | last post by:
Hi, I am developing a software in Python using Tkinter. The choice of my team is not to use pyton MegaWidgets. I would like to scroll a frame. This is a peace of my code : #...
2
by: Paul | last post by:
I have a simple frame-based application where title information appears in a top frame and a lower frame contains the content for the application. One of the needs for this app is for a status...
1
by: Kenneth Montgomery | last post by:
I have this embedded dropdown menu applet that is suppose to be in the navigation frame and the target URL content in the content frame. But I can't seem to the script to put the content into the...
2
by: Maik Wiege | last post by:
Hi! I want to show a blinking text over my derived CMDIChildWnd-class. The blinking is done by one view which is hold by my frame. I set up a timer and write text to the parent frame, which works...
3
by: Dai Ba Wong | last post by:
Hi: Currently I am having a problem with my webpage. My page consist of two frames, one consist of input text field and the other contains link for different pop-up windows. The problem...
5
by: Martin Chen | last post by:
I have a frame set (as per MS FrontPage 2000). It has a contents and a main frame. The contents frame has a menu bar written with with javascript (in the context of a table). In IE6.1 everything...
5
by: Hank Mishkoff | last post by:
Is there any way to use JavaScript to determine how much text will fit into a non-scrolling browser frame? I have a non-scrolling frame in which I want to insert some text. I know that the text...
1
by: laredotornado | last post by:
Hi, I have this master frameset page <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD> <TITLE>Account Creation</TITLE> <META HTTP-EQUIV="Content-Type"...
2
by: Abneo | last post by:
Hi all, I am very new to Javascript and I am in some need of some help. I am creating a site that has a madlib. I got the madlib code but now I want the results of the madlib to display in...
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
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.