Guest tsenart Posted April 23, 2007 at 07:27 PM Report Share #95455 Posted April 23, 2007 at 07:27 PM Olá pessoal... Alguém me sabe dizer porque é que este código funciona no IE6 e não funciona no Firefox? <html> <head> <script type="text/javascript"> function load(iframe1URL) { parent.frames['principal'].location.href=iframe1URL+".htm"; } </script> <meta http-equiv="Content-Language" content="pt"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>10ºA @ Escola Secundária D. Filipa de Lencastre</title> <base target="dcimo"> </head> <body> <p> </p> <p><font size="4" face="Berlin Sans FB">Escolha o número do aluno para aceder à sua página.</font></p> <p> <select size="1" name="D1"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> <option value="22">22</option> <option value="23">23</option> <option value="24">24</option> <option value="25">25</option> <option value="26">26</option> <option value="27">27</option> <option value="28">28</option> </select> <input type="button" name="btngo" value="Ir" onclick="load(D1.value);"></p> <p> </p> <p> </p> </body> </html> Link to comment Share on other sites More sharing options...
Sven Posted April 23, 2007 at 07:45 PM Report Share #95464 Posted April 23, 2007 at 07:45 PM tenta assim <select size="1" name="D1" id="D1"> ... <input type="button" name="btngo" value="Ir" onclick="var cmb = document.getElementById('D1'); load(cmb.options[cmb.selectedIndex].value);"> Writing software is more fun than workingO covil do Barão Link to comment Share on other sites More sharing options...
Guest tsenart Posted April 23, 2007 at 07:59 PM Report Share #95469 Posted April 23, 2007 at 07:59 PM Yup já funciona.... Mas podias-me explicar porquê que não dá da outra maneira no Firefox? Link to comment Share on other sites More sharing options...
marinheiro Posted April 23, 2007 at 08:21 PM Report Share #95477 Posted April 23, 2007 at 08:21 PM porque o name é para o ie e o id é para os outros browsers... há 10 tipos de pessoas: as que sabem binário e as que não sabem... todas as nossas vidas não passam de release candidates... com o aperfeiçoamento, um dia chegaremos à versão final.. Link to comment Share on other sites More sharing options...
shumy Posted April 23, 2007 at 08:26 PM Report Share #95478 Posted April 23, 2007 at 08:26 PM Manias da Microsoft. Até porque o name mais tarde ao mais cedo é para desaparecer. Aqui há coisa de 2 anos fazia umas malhas de croché, depois fartei-me e fui para informática! Link to comment Share on other sites More sharing options...
Sven Posted April 23, 2007 at 11:03 PM Report Share #95512 Posted April 23, 2007 at 11:03 PM não é bem assim, o name serve para retornar os valores do form por exemplo o id para ser usado com o javascript o ie é mais tolerante neste aspecto Writing software is more fun than workingO covil do Barão Link to comment Share on other sites More sharing options...
jreis Posted April 24, 2007 at 09:01 AM Report Share #95529 Posted April 24, 2007 at 09:01 AM Eu acho que também tem a ver (digo eu) com o facto de se chamar logo a propriedade value sobre o objecto, em vez de chamar cmb.options[cmb.selectedIndex].value, penso que só o IE retorna alguma coisa (de jeito) quando chamado assim (directamente pelo value), mas posso tar enganado... "Pensa positivo: tudo pode piorar" Link to comment Share on other sites More sharing options...
Guest tsenart Posted April 24, 2007 at 03:47 PM Report Share #95589 Posted April 24, 2007 at 03:47 PM Eu como tenho agora é assim: <html> <head> <script type="text/javascript"> function load(URL) { parent.frames['principal'].location.replace("sites_alunos/" + URL + ".htm"); } </script> <meta http-equiv="Content-Language" content="pt"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>10ºA @ Escola Secundária D. Filipa de Lencastre</title> <base target="main"> </head> <body background="fundovert.png"> <p> </p> <p><font size="4" face="Berlin Sans FB" color="#008000">Escolha o número do aluno para aceder à sua página.</font></p> <p> <select size="1" id="D1"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> <option value="22">22</option> <option value="23">23</option> <option value="24">24</option> <option value="25">25</option> <option value="26">26</option> <option value="27">27</option> <option value="28">28</option> </select> <input type="button" name="btngo" value="Ir" onclick="load(getElementById('D1').value);"> </p> <p> </p> <p> </p> </body> </html> Funciona perfeitamente. Link to comment Share on other sites More sharing options...
jreis Posted April 24, 2007 at 04:16 PM Report Share #95595 Posted April 24, 2007 at 04:16 PM fixe 👍 "Pensa positivo: tudo pode piorar" Link to comment Share on other sites More sharing options...
webmaster-pt Posted May 23, 2007 at 11:12 AM Report Share #102234 Posted May 23, 2007 at 11:12 AM Espero ke essa info não seja para indexar nos motores de busca 😛 frames = inimigas dos spiders Link to comment Share on other sites More sharing options...
Guest tsenart Posted May 23, 2007 at 07:18 PM Report Share #102371 Posted May 23, 2007 at 07:18 PM Não... Não é. O site é este. Link to comment Share on other sites More sharing options...
nram Posted May 24, 2007 at 07:39 AM Report Share #102434 Posted May 24, 2007 at 07:39 AM caixa mágica é uma distribuição portuguesa??? :S Link to comment Share on other sites More sharing options...
djthyrax Posted May 24, 2007 at 11:36 AM Report Share #102465 Posted May 24, 2007 at 11:36 AM caixa mágica é uma distribuição portuguesa??? :S É. 👍 Não peças ajuda por PM! A tua dúvida vai ter menos atenção do que se for postada na secção correcta do fórum! Link to comment Share on other sites More sharing options...
nram Posted May 24, 2007 at 05:36 PM Report Share #102528 Posted May 24, 2007 at 05:36 PM é sim... estava a pensar noutra coisa... LooL.. 😉👍 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now