login  Naam:   Wachtwoord: 
Registreer je!
 Forum

OnClick= pagina in iframe openen... Hoe?

Offline skyflyer - 19/03/2006 23:08 (laatste wijziging 19/03/2006 23:12)
Avatar van skyflyerNieuw lid Helloow,
ik ben weer aan iets anders begonnen voor mijne website omdat mijn ander dus op niks trok... :-)

Nu werk ik met een iframe... Maarr...

als ik op de navigatieknop druk zou in het iframe een andere pagina moeten komen... Dus achter onClick zou ik iets moeten zetten da die inhoud van da iframe kan veranderen... Kunnen jullie me soms helpen?

Alvast bedankt...

SkyFlyer

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <HTML>
  3. <HEAD>
  4. <TITLE>WWW.STIJNSTROOBANTS.BE - Officiële website</TITLE>
  5. <META http-equiv=Content-Type content="text/html; charset=windows-1252">
  6. <META content="ronk, lab, ronk-lab, 2k5" name=keywords>
  7. <META content="MSHTML 6.00.2900.2802" name=GENERATOR><LINK
  8. href="bestanden/styles.css" rel=stylesheet>
  9. <SCRIPT language=javascript src="script.js"
  10. rel="javascript"></SCRIPT>
  11. </HEAD>
  12. <BODY>
  13. <DIV class=top><IMG src="bestanden/top.jpg"></DIV>
  14. <DIV class=copyright><IMG src="bestanden/copyright.jpg"></DIV>
  15. <DIV id=main>
  16. <TABLE class=box>
  17. <TBODY>
  18. <TR>
  19. <TD class=box1 width="80%">
  20.  
  21. <TABLE class=content align=center>
  22. <TBODY>
  23. <TR>
  24. <TD bgColor=#d1d1d1><IFRAME name=eins align=left marginWidth=0
  25. marginHeight=0 src="iframe/index.htm" frameBorder=0
  26. width="100%" scrolling=yes
  27. height=350></IFRAME></TD></TR></TBODY></TABLE></TD>
  28. <TD class=box2 width="20%">
  29.  
  30. <TABLE class=navigation align=center>
  31. <TBODY>
  32. <TR>
  33. <TD bgColor=#e5ccaa>+index</TD></TR>
  34. <TR>
  35. <TD onmouseover="this.style.backgroundColor='#E5CCAA'"
  36. onclick=javascript:link_niews();
  37. onmouseout="this.style.backgroundColor='#F2D7B3'"
  38. bgColor=#f2d7b3>+niews</TD></TR>
  39. <TR>
  40. <TD onmouseover="this.style.backgroundColor='#E5CCAA'"
  41. onclick=javascript:link_biografie();
  42. onmouseout="this.style.backgroundColor='#F2D7B3'"
  43. bgColor=#f2d7b3>+biografie</TD></TR>
  44. <TR>
  45. <TD onmouseover="this.style.backgroundColor='#E5CCAA'"
  46. onclick=javascript:link_trainers();
  47. onmouseout="this.style.backgroundColor='#F2D7B3'"
  48. bgColor=#f2d7b3>+trainers</TD></TR>
  49. <TR>
  50. <TD onmouseover="this.style.backgroundColor='#E5CCAA'"
  51. onclick=javascript:link_resultaten();
  52. onmouseout="this.style.backgroundColor='#F2D7B3'"
  53. bgColor=#f2d7b3>+resultaten</TD></TR>
  54. <TR>
  55. <TD onmouseover="this.style.backgroundColor='#E5CCAA'"
  56. onclick=javascript:link_fotogallerij();
  57. onmouseout="this.style.backgroundColor='#F2D7B3'"
  58. bgColor=#f2d7b3>+fotogallerij</TD></TR>
  59. <TR>
  60. <TD onmouseover="this.style.backgroundColor='#E5CCAA'"
  61. onclick=javascript:link_videos();
  62. onmouseout="this.style.backgroundColor='#F2D7B3'"
  63. bgColor=#f2d7b3>+video's</TD></TR>
  64. <TR>
  65. <TD onmouseover="this.style.backgroundColor='#E5CCAA'"
  66. onclick=javascript:link_sponsors();
  67. onmouseout="this.style.backgroundColor='#F2D7B3'"
  68. bgColor=#f2d7b3>+sponsors</TD></TR>
  69. <TR>
  70. <TD onmouseover="this.style.backgroundColor='#E5CCAA'"
  71. onclick=javascript:link_gastenboek();
  72. onmouseout="this.style.backgroundColor='#F2D7B3'"
  73. bgColor=#f2d7b3>+gastenboek</TD></TR>
  74. <TR>
  75. <TD onmouseover="this.style.backgroundColor='#E5CCAA'"
  76. onclick=javascript:link_contact();
  77. onmouseout="this.style.backgroundColor='#F2D7B3'"
  78. bgColor=#f2d7b3>+contact</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV></BODY></HTML>

11 antwoorden

Gesponsorde links
Offline Thomas - 19/03/2006 23:30
Avatar van Thomas Moderator Volgens mij kun je i-frames op dezelfde manier aanspreken als gewone frames, dus geef je i-frame een naam, en verander de source hiervan met document.frames['iframe_naam'].src = "whatever.htm"?
Offline skyflyer - 20/03/2006 10:12
Avatar van skyflyer Nieuw lid Hmmm en wat moet ik dan in deze regel aanpassen...?

  1. ><IFRAME name=eins align=left marginWidth=0
  2. marginHeight=0 src="iframe/index.htm" frameBorder=0
  3. width="100%" scrolling=yes
  4. height=350></IFRAME>
Offline ReneeJ - 20/03/2006 10:36
Avatar van ReneeJ HTML interesse niks.. maar dan moet je het zo openen
document.frames['eins'].src = "whatever.htm"
Offline skyflyer - 20/03/2006 10:49
Avatar van skyflyer Nieuw lid Hmmm... dus deze code zou moeten werken...
Het werkt nog niet en ik zou niet weten welke bug er nog inzit...

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <HTML>
  3. <HEAD>
  4. <TITLE>WWW.STIJNSTROOBANTS.BE - Officiële website</TITLE>
  5. <META http-equiv=Content-Type content="text/html; charset=windows-1252">
  6. <META content="ronk, lab, ronk-lab, 2k5" name=keywords>
  7. <META content="MSHTML 6.00.2900.2802" name=GENERATOR>
  8. <LINK href="bestanden/styles.css" rel=stylesheet>
  9. <SCRIPT language=javascript src="script.js" rel="javascript"></SCRIPT>
  10. </HEAD>
  11.  
  12. <BODY>
  13. <DIV class=top><IMG src="bestanden/top.jpg"></DIV>
  14. <DIV class=copyright><IMG src="bestanden/copyright.jpg"></DIV>
  15. <DIV id=main>
  16. <TABLE class=box>
  17. <TBODY>
  18. <TR>
  19. <TD class=box1 width="80%">
  20.  
  21. <TABLE class=content align=center>
  22. <TBODY>
  23. <TR>
  24. <TD bgColor=#d1d1d1><IFRAME name="iframe" id="iframe" align=left marginWidth=0
  25. marginHeight=0 src="iframe/index.htm" frameBorder=0
  26. width="100%" scrolling=yes
  27. height=350></IFRAME></TD></TR></TBODY></TABLE></TD>
  28. <TD class=box2 width="20%">
  29.  
  30. <TABLE class=navigation align=center>
  31. <TBODY>
  32. <TR>
  33. <TD bgColor=#e5ccaa>+index</TD></TR>
  34. <TR>
  35. <TD onmouseover="this.style.backgroundColor='#E5CCAA'"
  36. onclick=javascript:document.frames['iframe'].src = "iframe/nieuws.htm";
  37. onmouseout="this.style.backgroundColor='#F2D7B3'"
  38. bgColor=#f2d7b3>+niews</TD></TR>
  39. <TR>
  40. <TD onmouseover="this.style.backgroundColor='#E5CCAA'"
  41. onclick=javascript:document.frames['iframe'].src = "iframe/2.htm";
  42. onmouseout="this.style.backgroundColor='#F2D7B3'"
  43. bgColor=#f2d7b3>+biografie</TD></TR>
  44. <TR>
  45. <TD onmouseover="this.style.backgroundColor='#E5CCAA'"
  46. onclick=javascript:document.frames['iframe'].src = "iframe/3.htm";
  47. onmouseout="this.style.backgroundColor='#F2D7B3'"
  48. bgColor=#f2d7b3>+trainers</TD></TR>
  49. <TR>
  50. <TD onmouseover="this.style.backgroundColor='#E5CCAA'"
  51. onclick=javascript:document.frames['iframe'].src = "iframe/4.htm";
  52. onmouseout="this.style.backgroundColor='#F2D7B3'"
  53. bgColor=#f2d7b3>+resultaten</TD></TR>
  54. <TR>
  55. <TD onmouseover="this.style.backgroundColor='#E5CCAA'"
  56. onclick=javascript:document.frames['iframe'].src = "iframe/5.htm";
  57. onmouseout="this.style.backgroundColor='#F2D7B3'"
  58. bgColor=#f2d7b3>+fotogallerij</TD></TR>
  59. <TR>
  60. <TD onmouseover="this.style.backgroundColor='#E5CCAA'"
  61. onclick=javascript:document.frames['iframe'].src = "iframe/6.htm";
  62. onmouseout="this.style.backgroundColor='#F2D7B3'"
  63. bgColor=#f2d7b3>+video's</TD></TR>
  64. <TR>
  65. <TD onmouseover="this.style.backgroundColor='#E5CCAA'"
  66. onclick=javascript:document.frames['iframe'].src = "iframe/7.htm";
  67. onmouseout="this.style.backgroundColor='#F2D7B3'"
  68. bgColor=#f2d7b3>+sponsors</TD></TR>
  69. <TR>
  70. <TD onmouseover="this.style.backgroundColor='#E5CCAA'"
  71. onclick=javascript:document.frames['iframe'].src = "iframe/8.htm";
  72. onmouseout="this.style.backgroundColor='#F2D7B3'"
  73. bgColor=#f2d7b3>+gastenboek</TD></TR>
  74. <TR>
  75. <TD onmouseover="this.style.backgroundColor='#E5CCAA'"
  76. onclick=javascript:document.frames['iframe'].src = "iframe/9.htm";
  77. onmouseout="this.style.backgroundColor='#F2D7B3'"
  78. bgColor=#f2d7b3>+contact</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV></BODY></HTML>
Offline ReneeJ - 20/03/2006 11:08
Avatar van ReneeJ HTML interesse nee overal staat

  1. <TD onmouseover="this.style.backgroundColor='#E5CCAA'"
  2. onclick=javascript:document.frames['iframe'].src = "iframe/8.htm";
  3. onmouseout="this.style.backgroundColor='#F2D7B3'"
  4. bgColor=#f2d7b3>+gastenboek</TD>


dat stukje waar ['iframe'] staat moet je vervangen door ['eins']

dan werkt het denk ik
Offline skyflyer - 20/03/2006 11:11 (laatste wijziging 21/03/2006 09:15)
Avatar van skyflyer Nieuw lid Maar ik heb "name" en "id" aangepast van mn iframe...

  1. <IFRAME name="iframe" id="iframe" align=left marginWidth=0
  2. marginHeight=0 src="iframe/index.htm" frameBorder=0
  3. width="100%" scrolling=yes
  4. height=350></IFRAME>



Dus waar kan de fout dan nog liggen..?
Ik snap het niet meer... 
Offline BramBo - 21/03/2006 10:27 (laatste wijziging 21/03/2006 10:27)
Avatar van BramBo JS gevorderde onclick=javascript:document.frames['iframe'].src = "iframe/8.htm";

kan niet.. Maak er van :
onclick="javascript:document.frames['iframe'].src = 'iframe/8.htm';"
Offline skyflyer - 21/03/2006 12:39
Avatar van skyflyer Nieuw lid Heb ik nu juist geprobeerd... Maar wil nog niet werken...

Hier weer eens de volledige code tot nu toe...

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <HTML>
  3. <HEAD>
  4. <TITLE>WWW.STIJNSTROOBANTS.BE - Officiële website</TITLE>
  5. <META http-equiv=Content-Type content="text/html; charset=windows-1252">
  6. <META content="ronk, lab, ronk-lab, 2k5" name=keywords>
  7. <META content="MSHTML 6.00.2900.2802" name=GENERATOR>
  8. <LINK href="bestanden/styles.css" rel=stylesheet>
  9. <SCRIPT language=javascript src="script.js" rel="javascript"></SCRIPT>
  10. </HEAD>
  11.  
  12. <BODY>
  13. <DIV class=top><IMG src="bestanden/top.jpg"></DIV>
  14. <DIV class=copyright><IMG src="bestanden/copyright.jpg"></DIV>
  15. <DIV id=main>
  16. <TABLE class=box>
  17. <TBODY>
  18. <TR>
  19. <TD class=box1 width="80%">
  20.  
  21. <TABLE class=content align=center>
  22. <TBODY>
  23. <TR>
  24. <TD bgColor=#d1d1d1><IFRAME name="iframe" id="iframe" align=left marginWidth=0
  25. marginHeight=0 src="iframe/index.htm" frameBorder=0
  26. width="100%" scrolling=yes
  27. height=350></IFRAME></TD></TR></TBODY></TABLE></TD>
  28. <TD class=box2 width="20%">
  29.  
  30. <TABLE class=navigation align=center>
  31. <TBODY>
  32. <TR>
  33. <TD bgColor=#e5ccaa>+index</TD></TR>
  34. <TR>
  35. <TD onmouseover="this.style.backgroundColor='#E5CCAA'"
  36. onclick="javascript:document.frames['iframe'].src = 'iframe/nieuws.htm';"
  37. onmouseout="this.style.backgroundColor='#F2D7B3'"
  38. bgColor=#f2d7b3>+niews</TD></TR>
  39. <TR>
  40. <TD onmouseover="this.style.backgroundColor='#E5CCAA'"
  41. onclick="javascript:document.frames['iframe'].src = 'iframe/2.htm';"
  42. onmouseout="this.style.backgroundColor='#F2D7B3'"
  43. bgColor=#f2d7b3>+biografie</TD></TR>
  44. <TR>
  45. <TD onmouseover="this.style.backgroundColor='#E5CCAA'"
  46. onclick="javascript:document.frames['iframe'].src = 'iframe/3.htm';"
  47. onmouseout="this.style.backgroundColor='#F2D7B3'"
  48. bgColor=#f2d7b3>+trainers</TD></TR>
  49. <TR>
  50. <TD onmouseover="this.style.backgroundColor='#E5CCAA'"
  51. onclick="javascript:document.frames['iframe'].src = 'iframe/4.htm';"
  52. onmouseout="this.style.backgroundColor='#F2D7B3'"
  53. bgColor=#f2d7b3>+resultaten</TD></TR>
  54. <TR>
  55. <TD onmouseover="this.style.backgroundColor='#E5CCAA'"
  56. onclick="javascript:document.frames['iframe'].src = 'iframe/5.htm';"
  57. onmouseout="this.style.backgroundColor='#F2D7B3'"
  58. bgColor=#f2d7b3>+fotogallerij</TD></TR>
  59. <TR>
  60. <TD onmouseover="this.style.backgroundColor='#E5CCAA'"
  61. onclick="javascript:document.frames['iframe'].src = 'iframe/6.htm';"
  62. onmouseout="this.style.backgroundColor='#F2D7B3'"
  63. bgColor=#f2d7b3>+video's</TD></TR>
  64. <TR>
  65. <TD onmouseover="this.style.backgroundColor='#E5CCAA'"
  66. onclick="javascript:document.frames['iframe'].src = 'iframe/7.htm';"
  67. onmouseout="this.style.backgroundColor='#F2D7B3'"
  68. bgColor=#f2d7b3>+sponsors</TD></TR>
  69. <TR>
  70. <TD onmouseover="this.style.backgroundColor='#E5CCAA'"
  71. onclick="javascript:document.frames['iframe'].src = 'iframe/8.htm';"
  72. onmouseout="this.style.backgroundColor='#F2D7B3'"
  73. bgColor=#f2d7b3>+gastenboek</TD></TR>
  74. <TR>
  75. <TD onmouseover="this.style.backgroundColor='#E5CCAA'"
  76. onclick="javascript:document.frames['iframe'].src = 'iframe/9.htm';"
  77. onmouseout="this.style.backgroundColor='#F2D7B3'"
  78. bgColor=#f2d7b3>+contact</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV></BODY></HTML>
Offline WumTol - 21/03/2006 13:49 (laatste wijziging 21/03/2006 13:49)
Avatar van WumTol PHP beginner javascript: parent.iframenaam.location.href='pagina.htm';
Offline skyflyer - 21/03/2006 14:46
Avatar van skyflyer Nieuw lid Bedankt allemaal om mee te werken.

WumTol, jouw code is perfect. THX!!
Offline WumTol - 21/03/2006 15:02
Avatar van WumTol PHP beginner Geen dank 
Gesponsorde links
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.258s