Click to See Complete Forum and Search --> : Forcer un clic


drouyet
07-12-2003, 06:37 AM
Bonjour,

Voici mon problème.

Pour l'instant, il reste dans mon site des pages qui, si on les appelle directement, ne sont pas contenues dans des frames.

Ca veut dire que les gens qui visitent ne voient pas le reste du site.

Jusque là, j'avais trouvé du code qui permette de renvoyer vers une autre page quand la page appelée ne l'est pas depuis un FRAMESET.

Ce que j'aimerais ensuite, après l'affichage de ma page principale, c'est que l'autre page soit appelée dans le frame de droite, en fait en forçant le clic sur un lien de mon treeView (frame de gauche).

Voir les cas suivants :
1) http://www.rouyet.com/statistiques.php Cette page renvoie vers l'accueil mais sans qu'elle ne soit réouverte dans un frame ensuite :( .
2) http://www.rouyet.com/theatre.php Cette page ne renvoie pas vers l'accueil.

Pour toutes mes pages (sauf l'accueil), j'aimerais que l'accueil soit appelé puis la page correspondante appelée automatiquement (pour que le visiteur ne doive pas chercher la page qu'il croyait voir).

D'avance merci pour votre aide.

Me contacter depuis www.rouyet.com page "Contacts".

Khalid Ali
07-12-2003, 10:32 AM
You had allot more chances of getting a response to your problem if you used english as your questions language...

drouyet
07-12-2003, 01:40 PM
This message is in English. Sorry for the one in French. Stupid am I !

I'd like to load in a frameset a page who is not in a frameset.

I have managed to load homepage when you load another one (this last not in a frameset).

What I mean :
- If you go to http://www.rouyet.com/statistiques.php, you'll be redirected to http://www.rouyet.com.
- If you go to http://www.rouyet.com/theatre.php, you won't be redirected.

I can redirect http://www.rouyet.com/theatre.php to http://www.rouyet.com but then http://www.rouyet.com/theatre.php is not loaded automatically (in a frameset).

I'd like to do this for all pages except home page.

So, it would be as if visitor clicked on a link in my treeview menu (but he was coming directly from that page).

As a summary : if you go to http://www.rouyet.com/theatre.php, i'd like to load homepage and then automatically http://www.rouyet.com/theatre.php again BUT IN A FRAMESET.

How can I do ?

Khalid Ali
07-12-2003, 04:46 PM
If I understand tyou correctly you are lookig for something like this.

<script type="text/javascript">
if(self.location==top.location)self.location="index.html";
</script>

drouyet
07-14-2003, 12:49 PM
As a said in a private message, I'd like to reload first the homepage when you load a page that is not in a frameset - let's call it 'test.html' (your code seems to be OK) and then reload 'test.html' in the right frame (as if you were clicking in the menu in the left frame).

1) Detect that the loaded page isn't in a frameset.
2) Load the homepage.
3) Load the other page in the right frame.

That's what I'd like to be able to do.

Your code helps to reload 'index.html' but more than that, I'd like to reload another page automatically just after that.

Thanks for your help.

;)