Notizie: scarica ora l'ultima versione disponibile di SeaMonkey!

Autore Topic: Problema link target con iframe  (Letto 2429 volte)

0 Utenti e 1 Visitatore stanno visualizzando questo topic.

Offline stiffa

  • Post: 12
Problema link target con iframe
« il: 21 Novembre 2005 10:25:17 »
Ciao a tutti. Questo e' il mio primo post. Spero di ottenere la tanto attesa risposta visto che qui si parla proprio di firefox.
Sostanzialmente il mio problema e' che in un frame ho un albero di cartelle e se clikko un link(la cartella) dovrei far cambiare un secondo frame a fianco del primo.
questa cosa qui e' banale...nel senso...con poco codice ci riesci tranquillamente...purtroppo, a forza di andare a vanti con questo progetto, mi ritrovo con un grosso quantitativo di codice, e da qualche parte ci deve essere qualcosa che mi frega il target dei link

Il tutto su explorer va perfetto mentre su mozilla firefox non va una mazza.

Vi posto il codice :

ecco il codice:

Codice: [Seleziona]
//*************************pagina dannato.php**********************

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>SimplytheBest DHTML tabbed notes script</title>

<meta name="keywords" content="DHTML scripts, tab, notes, messages">
<meta name="keywords" content="DHTML scripts, tabbed notes, tab, notes, dhtml script, javascript">
<meta name="description" content="Simply the Best DHTML scripts and javascripts: tabbed notes.">
<meta name="target" content="DHTML scripts, tabbed notes">
<meta name="copyright" content="copyright 1997-2005 SimplytheBest.net">
<meta name="revisit-after" content="14 days">
<meta name="robots" content="all">
<link rel="stylesheet" href="../scripts.css" type="text/css">
<style type="text/css">

<!--
.conts { visibility: hidden }
.tab { font-family: Verdana; font-size: 8pt; font-weight: normal; text-align: center;
border-left: thin solid #e0e0e0; border-right: thin solid gray;
border-top: thin solid #e0e0e0;
cursor:pointer;
}
.selTab { font-family: Verdana; font-size: 8pt; font-weight: bold; text-align: center;
border-left: thin solid #000080;
border-right: thin solid #000080;
border-top: thin solid #000080;
cursor:pointer;
}
-->
</style>


<script language =" javascript" type="text/javascript">



// Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/
//a public function that the container uses to pass in values for the labels
function public_Labels(label1, label2, label3, label4, label5, label6, label7){

document.getElementById("t1").innerText = label1;
document.getElementById("t2").innerText = label2;
document.getElementById("t3").innerText = label3;
document.getElementById("t4").innerText = label4;
document.getElementById("t5").innerText = label5;
document.getElementById("t6").innerText = label6;
document.getElementById("t7").innerText = label7;
}
//a public function that the container uses to pass in values for the card containers
function public_Contents(contents1, contents2, contents3, contents4, contents5, contents6, contents7){
document.getElementById("t1Contents").innerHTML = contents1;
document.getElementById("t2Contents").innerHTML = contents2;
document.getElementById("t3Contents").innerHTML = contents3;
document.getElementById("t4Contents").innerHTML = contents4;
document.getElementById("t5Contents").innerHTML = contents5;
document.getElementById("t6Contents").innerHTML = contents6;
document.getElementById("t7Contents").innerHTML = contents7;
init();
}
//sets the default display to tab 1
function init(){
document.getElementById("tabContents").innerHTML = document.getElementById("t1Contents").innerHTML;
}
//this is the tab switching function
var currentTab;
var tabBase;
var firstFlag = true;

function changeTabs(tabID){
if(firstFlag == true){
currentTab = document.getElementById("t1");
tabBase = document.getElementById("t1base");
firstFlag = false;
}
if(document.getElementById(tabID).className == "tab"){
currentTab.className = "tab";
tabBase.style.backgroundColor = "white";
currentTab = document.getElementById(tabID);
tabBaseID = currentTab.id + "base";
tabContentID = currentTab.id + "Contents";
tabBase = document.getElementById(tabBaseID);
tabContent = document.getElementById(tabContentID);
currentTab.className = "selTab";
tabBase.style.backgroundColor = "";
document.getElementById("tabContents").innerHTML = tabContent.innerHTML;
}
}
</SCRIPT>
</head>
<body onload="init();" text="#000000" link="#0000A0" vlink="#0000A0" alink="#0000A0">

<!-- DHTML scripts, tabbed notes script -->


<!-- Script start -->
<table bgcolor="#FFA500" cellpadding="0" cellspacing="0" style="HEIGHT: 500px; WIDTH: 850px" class="body" ID="Table1">
<tbody>
<tr>
<td class="selTab" onclick="changeTabs('t1')" height="25" id="t1">TwineXp</td>
<td class="tab" onclick="changeTabs('t2')" id="t2">Network</td>
<td class="tab" onclick="changeTabs('t3')" id="t3">Emulatore</td>
<td class="tab" onclick="changeTabs('t4')" id="t4">Utenti</td>


</tr>
<tr>
<td id="t1base" style="BORDER-LEFT: gray thin solid; HEIGHT: 1px"></td>
<td id="t2base" style="BACKGROUND-COLOR: white; HEIGHT: 1px"></td>
<td id="t3base" style="BACKGROUND-COLOR: white; HEIGHT: 1px"></td>
<td id="t4base" style="BACKGROUND-COLOR: white; HEIGHT: 1px"></td>

</tr>
<tr>
<td colspan="7" height="*" id="tabContents" style="BORDER-BOTTOM: gray thin solid; BORDER-LEFT: gray thin solid; BORDER-RIGHT: gray thin solid"> </td>
</tr>
</tbody>
</table>

<div class="conts" id="t1Contents" style="width: 500; height: 10">
<table align =" center" width =" 700" >

<tr>
<td valign =" top">
<iframe src ="dannatosx.php" width =" 200" height =" 400">
</iframe>
</td>

<td valign =" top">
<iframe width =" 600" height =" 400" name ="pippo">
</iframe>
</td>
</tr>
</table>
</div>
<div class="conts" id="t2Contents" style="width: 459; height: 120">
blablabla
</div>
<div class="conts" id="t3Contents" style="width: 460; height: 38">
sdasdasdad
</div>
<div class="conts" id="t4Contents" style="width: 460; height: 88" >
blalbllvlvlblbl
</div>
<div class="conts" id="t5Contents" style="width: 460; height: 37">
<p align="center" class="body"><b>And so on..</b></p>
</div>
<div class="conts" id="t6Contents" style="width: 460; height: 37">
<p align="center" class="body"><b>And so on..</b></p>

</div>

<div class="conts" id="t7Contents" style="width: 460; height: 37">
<p align="center" class="body"><b>
Scroll a little down the page for instructions!</b></p>
</div>


<!-- Script end -->

</body>
</html>



Codice: [Seleziona]
//*************************pagina dannatosx.php**********************

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>SimplytheBest DHTML tabbed notes script</title>
</head>
<body>
<a href = "admin.php" target="pippo">vaiiiii</a>
</body>
</html>


Pls help me .....grazie

ho messo il codice nell'apposito tag
per favore, esiste un tag proprio per inserire codice, usiamolo!

tripleshift

Offline Underpass

  • I've got fabric to sell
  • Amministratore
  • Post: 24618
    • Mozilla Italia
Problema link target con iframe
« Risposta #1 il: 21 Novembre 2005 10:41:22 »
Ti pregherei di inserire il codice all'interno dell'apposito tag "codice":
Codice: [Seleziona]
[code][/code]  ;)
Ciao

Offline iacchi

  • Amministratore
  • Post: 6368
    • iacchiblog
Problema link target con iframe
« Risposta #2 il: 21 Novembre 2005 10:52:59 »
sposto nella sezione adatta

Offline stiffa

  • Post: 12
Problema link target con iframe
« Risposta #3 il: 21 Novembre 2005 12:42:18 »
....nessuno ???? niente di niente?

Offline tripleshift

  • Post: 1546
    • Don't push this button
Problema link target con iframe
« Risposta #4 il: 21 Novembre 2005 13:02:26 »
Citazione da: stiffa
....nessuno ???? niente di niente?


questo non è un help desk!
dopo un paio d'ore che t'aspetti? non si tratta neanche di un problema tecnico di ff.

calma e aspetta.

...

Offline klades

  • Moderatore
  • Post: 5788
    • http://www.nic-nac-project.org/~kaosmos
Problema link target con iframe
« Risposta #5 il: 21 Novembre 2005 13:19:21 »
Citazione da: tripleshift
calma e aspetta.

Concordo!

Comunque un modo crossbrowser per ottenere quello che cerchi potrebbe essere questo:
nel primo file aggiungi l'id agli iframe (ad es.
Codice: [Seleziona]

<iframe width =" 600" height =" 400" name ="pippo" id="pippo">
</iframe>

Nel secondo usare qualcosa del genere:
Codice: [Seleziona]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>SimplytheBest DHTML tabbed notes script</title>
<script>
function fillframe() {
parent.document.getElementById("pippo").src="admin.php";
}
</script>
</head>
<body>
<a href="dannatosx.php" onclick="fillframe()">vaiiiii</a>
</body>
</html>

E' un po' macchinoso ma mi sembra funzioni sia su ie che su firefox.
Penso che se cerchi un po' su google trovi metodi migliori ;-)
Ciao, Paolo

Offline stiffa

  • Post: 12
Problema link target con iframe
« Risposta #6 il: 21 Novembre 2005 14:32:16 »
Paolo....complimenti e grazie di cuore. Hai fatto quello che 150 persone su un altro forum non sono state capaci di fare....
Guarda....ti farei un monumento....

Solo una domanda....
Come mai clikkando il link mi cambia anche il frame di sinistra?

Offline klades

  • Moderatore
  • Post: 5788
    • http://www.nic-nac-project.org/~kaosmos
Problema link target con iframe
« Risposta #7 il: 21 Novembre 2005 22:02:50 »
Citazione da: stiffa
Come mai clikkando il link mi cambia anche il frame di sinistra?

Beh è normale che se clicchi su un link, venga caricata la pagina che sta in href no? :-)
Scherzi a parte, in realtà con Firefox basterebbe mettere a href="#" , ma stavolta non piace a IE...per mantenere il frame di sinistra anche con IE l'unico modo che ho trovato è ricaricare la stessa pagina. Onestamente non ti so spiegare questa anomalia di IE.

Offline stiffa

  • Post: 12
Problema link target con iframe
« Risposta #8 il: 22 Novembre 2005 08:53:18 »
.....grazie di avermi risposto....
Sarebbe carino andare a fondo a sta cosa ....non trovi?
Spero che ci sia gente interessata.
Cmq....come soluzione avrei pensato questa.....Controllo il browser in php e in base ad esso metto o no il "#" sull'href....che ne dici come soluzione alternativa?

Offline klades

  • Moderatore
  • Post: 5788
    • http://www.nic-nac-project.org/~kaosmos
Problema link target con iframe
« Risposta #9 il: 23 Novembre 2005 10:35:16 »
Mi fa piacere che il forum ti sia stato di aiuto, però capiamoci su una cosa: questo è un forum di supporto a Mozilla/Firefox e non è un forum di supporto per la costruzione dei siti.
Voglio dire che possiamo, nei limiti della possibilità e delle capacità di tutti, dare una mano a rendere compatibile un sito con Mozilla/Firefox, ma non puoi pretendere che ci mettiamo qui  insieme a te a costruire un sito da zero o quasi. Hai iniziato 4 thread in 24 ore, mi sembra un po' eccessivo, no? ;-) Anche perché in Rete trovi un sacco di materiale sull'argomento.
Tra l'altro risolvere problemi come quelli che poni tu richiede un bel po' di tempo (almeno a me!!!), tieni conto che certo nè io nè chi ti risponde qui fa il webmaster di professione.
Chiarito questo, mi spieghi che senso ha "uppare" questo thread?
Hai avuto una risposta, io di più non so dirti (onestamente non me ne frega nulla di indagare come IE interpreta il dom), e la domanda che hai posto è palesemente OT, dato che non affronta un problema di compatibilità, ma chiede un parere su come è meglio impostare il tuo sito server side.
Ed è perfettamente inutile che mostri impazienza, è anzi controproducente: se uno vuole e può risponderti, lo fa, in caso contrario non puoi prendertela mica, non trovi?
Ciao, Paolo

0 Utenti e 1 Visitatore stanno visualizzando questo topic.