[js]modification toute simple:affichage dans une frame

modification toute simple:affichage dans une frame [js] - HTML/CSS - Programmation

Marsh Posté le 19-07-2004 à 20:22:16    

veuillez m escuser mais je voudrais faire une modification toute simple a ce script js pour qu il m affiche chaque lien dans la frame nomee "body"  
Ce code sert a avoir 3 listes combinee  
Comment faire? ce doit etre tres simple pour vous !
Est ce que quelqu un peut completer le code  :)  
merci  :hello:  
 

Code :
  1. <FORM name="isc">
  2. <table width="375" border="0" cellspacing="0" cellpadding="0">
  3.   <tr align="center">
  4.     <td nowrap height="11"> 
  5. <select name="example" size="1" onChange="redirect(this.options.selectedIndex)">
  6. <option selected>---Select1-------------</option>
  7. <option>Webmaster Sites</option>
  8. <option>News Sites</option>
  9. </select>
  10. <select name="stage2" size="1" onChange="redirect1(this.options.selectedIndex)">
  11. <option value=" " selected> </option>
  12. <option value=" " selected>---Select2--------------</option>
  13. <option value=" " selected>---Select2--------------</option>
  14. </select>
  15. <select name="stage3" size="1" onChange="redirect2(this.options.selectedIndex)">
  16. <option value=" " selected> </option>
  17. <option value=" " selected>---Select3----------------</option>
  18. <option value=" " selected>---Select3----------------</option>
  19. </select>
  20. <script>
  21. <!--
  22. /*
  23. Triple Combo Script Credit
  24. By Hamid Cheheltani/ Website Abstraction (http://www.wsabstract.com)
  25. Visit http://wsabstract.com for this and over 400+ other scripts
  26. */
  27. var groups=document.isc.example.options.length
  28. var group=new Array(groups)
  29. for (i=0; i<groups; i++)
  30. group[i]=new Array()
  31. group[0][0]=new Option("---Select2---"," " );
  32. group[1][0]=new Option("Now Select This One"," " );
  33. group[1][1]=new Option("JavaScript","47" );
  34. group[1][2]=new Option("DHTML","46" );
  35. group[1][3]=new Option("CGI","45" );
  36. group[2][0]=new Option("Now Select This One"," " );
  37. group[2][1]=new Option("General News","115" );
  38. group[2][2]=new Option("Technology News","116" );
  39. var temp=document.isc.stage2
  40. function redirect(x){
  41. for (m=temp.options.length-1;m>0;m--)
  42. temp.options[m]=null
  43. for (i=0;i<group[x].length;i++){
  44. temp.options[i]=new Option(group[x][i].text,group[x][i].value)
  45. }
  46. temp.options[0].selected=true
  47. redirect1(0)
  48. }
  49. var secondGroups=document.isc.stage2.options.length
  50. var secondGroup=new Array(groups)
  51. for (i=0; i<groups; i++)  {
  52. secondGroup[i]=new Array(group[i].length)
  53. for (j=0; j<group[i].length; j++)  {
  54. secondGroup[i][j]=new Array()  }}
  55. secondGroup[0][0][0]=new Option("---Select 3---"," " );
  56. secondGroup[1][0][0]=new Option("---Select 3---"," " );
  57. secondGroup[1][1][0]=new Option("Now Select This One"," " );
  58. secondGroup[1][1][1]=new Option("Website Abstraction","http://wsabstract.com" );
  59. secondGroup[1][1][2]=new Option("JavaScript for the non programmer","http://webteacher.com/javascript/" );
  60. secondGroup[1][1][3]=new Option("Java-Scripts.net","http://java-scripts.net" );
  61. secondGroup[1][2][0]=new Option("Now Select This One"," " );
  62. secondGroup[1][2][1]=new Option("Dynamic Drive","http://www.dynamicdrive.com" );
  63. secondGroup[1][2][2]=new Option("Beginner\'s Guide to DHTML","http://www.geocities.com/ResearchTriangle/Facility/4490/" );
  64. secondGroup[1][2][3]=new Option("Web Coder","http://webcoder.com/" );
  65. secondGroup[1][3][0]=new Option("Now Select This One"," " );
  66. secondGroup[1][3][1]=new Option("CGI Resources","http://www.cgi-resources.com" );
  67. secondGroup[1][3][2]=new Option("Ada\'s Intro to CGI","http://adashimar.hypermart.net/" );
  68. secondGroup[2][0][0]=new Option("---Select 3---"," " );
  69. secondGroup[2][1][0]=new Option("Now Select This One"," " );
  70. secondGroup[2][1][1]=new Option("CNN","http://www.cnn.com" );
  71. secondGroup[2][1][2]=new Option("MSNBC","http://www.msnbc.com" );
  72. secondGroup[2][1][3]=new Option("ABC News","http://www.abcnews.com" );
  73. secondGroup[2][2][0]=new Option("Now Select A Page"," " );
  74. secondGroup[2][2][1]=new Option("News.com","http://www.news.com" );
  75. secondGroup[2][2][2]=new Option("Wired","http://www.wired.com" );
  76. var temp1=document.isc.stage3
  77. function redirect1(y){
  78. for (m=temp1.options.length-1;m>0;m--)
  79. temp1.options[m]=null
  80. for (i=0;i<secondGroup[document.isc.example.options.selectedIndex][y].length;i++){
  81. temp1.options[i]=new Option(secondGroup[document.isc.example.options.selectedIndex][y][i].text,secondGroup[document.isc.example.options.selectedIndex][y][i].value)
  82. }
  83. temp1.options[0].selected=true
  84. }
  85. function redirect2(z){
  86. window.location=temp1[z].value
  87. }
  88. //-->
  89. </script>
  90. </td>
  91. </tr>
  92. </table>
  93. </FORM>

Reply

Marsh Posté le 19-07-2004 à 20:22:16   

Reply

Marsh Posté le 19-07-2004 à 21:24:36    

pliz

Reply

Marsh Posté le 20-07-2004 à 11:58:50    

pliz

Reply

Marsh Posté le 20-07-2004 à 17:20:21    

remplace --> window.location=temp1[z].value  
par --> top.window.body.location=temp1[z].value


Message édité par Transistor le 20-07-2004 à 17:21:23
Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed