By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,011 Members | 2,968 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,011 IT Pros & Developers. It's quick & easy.

Frame text

Jacotheron
P: 44
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
Share this Question
Share on Google+
6 Replies


100+
P: 210
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

Jacotheron
P: 44
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

Jacotheron
P: 44
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
Expert Mod 15k+
P: 16,027
You're looking to keep your page framed.
Jan 24 '08 #5

Jacotheron
P: 44
You're looking to keep your page framed.
Thank you for the help. It is working like it should.
Jan 24 '08 #6

acoder
Expert Mod 15k+
P: 16,027
Thank you for the help. It is working like it should.
No problem. Glad you got it working.
Jan 25 '08 #7

Post your reply

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