[JS]Browser flipt, ik zie de fout niet...

Pagina: 1
Acties:

  • gitaarwerk
  • Registratie: Augustus 2001
  • Niet online

gitaarwerk

Plays piano,…

Topicstarter
Ik ben een frame script aan het schrijven, waarbij als je op dat frame komt (via zoekmachine ofzo) dat hij de frameset eromheen laadt.

Nu heb ik in het frameset de volgende staan:

PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<script type="text/javascript" language="JavaScript"><!--
var passed     = location.search ? unescape(location.search.substring(1)) + '&' : '';
var myLeft = passed ? passed.substring(0,passed.indexOf('&')) : 'left.html';
passed         = passed.substring(passed.indexOf('&')+1);
var myTop    = passed ? passed.substring(0,passed.indexOf('&')) : 'top.html';
passed         = passed.substring(passed.indexOf('&')+1);
var myMain     = passed ? passed.substring(0,passed.indexOf('&')) : 'main.html';

if (top != self)
    top.location.href = location.href;
else {


    document.write('  <frameset cols="0,*,0" border=0 frameborder="no">'); 
    document.write('    <frame  name="LEFTSPACE" scrolling="no" noresize marginwidth=0 marginheight=0 frameborder="NO" src="/pages/background.htm">');
    document.write('        <frameset rows="99,*" frameborder="NO" border="0" framespacing="0"> ');
    document.write('        <frame name="TOP" scrolling="NO" noresize src="' + myTop + '?referal=">');
    
    document.write('    <frameset cols="175,*" frameborder="NO" border="0" framespacing="0"> ');
    document.write('      <frame name="LEFT" scrolling="AUTO" noresize src="' + myLeft + '?referal=">');
    document.write('      <frame  name="MAIN" noresize scrolling="AUTO" marginwidth="0" marginheight="0" frameborder="NO" src="' + myMain + '?referal=">');
    document.write('<\/frameset>');
    document.write('        <\/frameset>');
    document.write('    <frame name="RIGHTSPACE" scrolling="NO" frameborder="NO" noresize marginwidth="0" marginheight="0" src="/pages/background.htm">');
    document.write('  <\/frameset>');

}
//--></script>


en in iedere mainpagina zelf:

PHP:
1
2
3
4
5
6
7
8
<script type="text/javascript" language="JavaScript">
<!--
if ((top == self) || (parent.frames[1].name != 'MAIN'))
{
    top.location.href = 'index.html?left.html&top.html&' + location.href; 
}
//-->
</script>


De fout zit in script nummer 2... als die hem laat gaat ie flippen...
Ik merk dat ie niet herkent als ie al in een frameset zit.. Ik weet niet goed hoe ik dit dan kan stoppen.

[ Voor 96% gewijzigd door gitaarwerk op 28-10-2004 12:03 ]

Ontwikkelaar van NPM library Gleamy


  • BtM909
  • Registratie: Juni 2000
  • Niet online

BtM909

Watch out Guys...

Je hebt deze toevallig niet compleet of online?

Volgens mij is het een combinatie van:
PHP:
1
2
if (top != self) 
    top.location.href = location.href;

en
PHP:
1
2
3
4
if ((top == self) || (parent.frames[1].name != 'MAIN')) 
{ 
    top.location.href = 'index.html?left.html&top.html&' + location.href; 
}


Maar dat dacht je waarschijnlijk zelf ook al ;)

Ace of Base vs Charli XCX - All That She Boom Claps (RMT) | Clean Bandit vs Galantis - I'd Rather Be You (RMT)
You've moved up on my notch-list. You have 1 notch
I have a black belt in Kung Flu.


  • gitaarwerk
  • Registratie: Augustus 2001
  • Niet online

gitaarwerk

Plays piano,…

Topicstarter
dit is het compleet, en nee, niet online..
hij geeft als titel de hele tijd ?referer= erachter.. dat loopt ie dus, de rest niet...

ik zal eens kijken als ik alleen doe wat er onder die else statement staat.

hmm.. even bekeken en dat stopt niets...

[ Voor 10% gewijzigd door gitaarwerk op 28-10-2004 12:12 ]

Ontwikkelaar van NPM library Gleamy


  • gitaarwerk
  • Registratie: Augustus 2001
  • Niet online

gitaarwerk

Plays piano,…

Topicstarter
script aangepast.. ENN.. gelukt :

PHP:
1
2
3
4
5
6
7
8
<script type="text/javascript" language="JavaScript">
<!--
if (top == self) 
{ 
    top.location.href = 'index.html?left.html&top.html&' + window.document.location; 
}
//-->
</script>


de regel : || (parent.frames[1].name != 'MAIN')

OF parent frame[1] naam = niet main..

maar wanneer gebruik je zoeits nou

Ontwikkelaar van NPM library Gleamy