Probuje zrobic dodawanie obrazkow przy pisaniu newsow, niestety mam maly problem i

chcialbym prosic was o pomoc.

Mam pliki:
index.html - otwierajacy pop up, miejsce wktore chce wstawic tekst
  1. <head>
  2. <title>stro</title>
  3. <script type="text/javascript">
  4. function okno () {
  5. window.open('stro.html','ble','width=300,height=200');
  6. }
  7.  
  8. function dodaj_obrazek (tekst){
  9. document.getElementById('obrazek').value = tekst;
  10. }
  11. </head>
  12.  
  13.  
  14.  
  15. <div id="readroot_postac">
  16. <input id="obrazek" name="obrazek" type="text" value="title"><a id="okno"
  17.  
  18. href="javascript:okno()">Otworz okno</a>
  19. </div>
  20.  
  21. </body>
  22. </html>


stro.html - w ktory bede otwieral kolejne strony, w niej wstawiam za pomoca js do

iframe strony wybrane z listy rozwijanej.
  1. <head>
  2. <title>stro</title>
  3. <script type="text/javascript">
  4.  
  5. /***********************************************
  6. * IFrame SSI script II- Š Dynamic Drive DHTML code library
  7.  
  8. (http://www.dynamicdrive.com)
  9. * Visit DynamicDrive.com for hundreds of original DHTML scripts
  10. * This notice must stay intact for legal use
  11. ***********************************************/
  12.  
  13. //Input the IDs of the IFRAMES you wish to dynamically resize to match its content
  14.  
  15. height:
  16. //Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or
  17.  
  18. [] for none:
  19. var iframeids=["myframe"]
  20.  
  21. //Should script hide iframe from browsers that don't support this script (non
  22.  
  23. IE5+/NS6+ browsers. Recommended):
  24. var iframehide="yes"
  25.  
  26. var
  27.  
  28. getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).sp
  29.  
  30. lit("/")[1]
  31. var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add
  32.  
  33. to iframe in FireFox 1.0+ browsers
  34.  
  35. function resizeCaller() {
  36. var dyniframe=new Array()
  37. for (i=0; i<iframeids.length; i++){
  38. if (document.getElementById)
  39. resizeIframe(iframeids[i])
  40. //reveal iframe for lower end browsers? (see var above):
  41. if ((document.all || document.getElementById) && iframehide=="no"){
  42. var tempobj=document.all? document.all[iframeids[i]] :
  43.  
  44. document.getElementById(iframeids[i])
  45. tempobj.style.display="block"
  46. }
  47. }
  48. }
  49.  
  50. function resizeIframe(frameid){
  51. var currentfr=document.getElementById(frameid)
  52. if (currentfr && !window.opera){
  53. currentfr.style.display="block"
  54. if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6
  55.  
  56. syntax
  57. currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight;
  58. else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
  59. currentfr.height = currentfr.Document.body.scrollHeight;
  60. if (currentfr.addEventListener)
  61. currentfr.addEventListener("load", readjustIframe, false)
  62. else if (currentfr.attachEvent){
  63. currentfr.detachEvent("onload", readjustIframe) // Bug fix line
  64. currentfr.attachEvent("onload", readjustIframe)
  65. }
  66. }
  67. }
  68.  
  69. function readjustIframe(loadevt) {
  70. var crossevt=(window.event)? event : loadevt
  71. var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
  72. if (iframeroot)
  73. resizeIframe(iframeroot.id);
  74. }
  75.  
  76. function loadintoIframe(iframeid, url){
  77. if (document.getElementById)
  78. document.getElementById(iframeid).src=url
  79. }
  80.  
  81. if (window.addEventListener)
  82. window.addEventListener("load", resizeCaller, false)
  83. else if (window.attachEvent)
  84. window.attachEvent("onload", resizeCaller)
  85. else
  86. window.onload=resizeCaller
  87.  
  88. function pokaz (co) {
  89.  
  90. document.getElementById('pokaz').innerHTML = co;
  91. document.getElementById('pokaz').style.display = block;
  92. }
  93.  
  94. </head>
  95. <div id="pokaz" style="display: none">javascript:loadintoIframe('myframe',
  96.  
  97. this.value)</div><a href="javascript:opener.dodaj_obrazek
  98. ('obrazek.jpg')">dodaj_obrazek</a>
  99. <form method="post" action="#">
  100. <select name="kategoria" onchange="javascript:loadintoIframe('myframe', this.value)">
  101. <option value="0">Wybierz kategorie</option>
  102. <option value="obrazki.html">Obrazki</option>
  103. </form>
  104. <iframe id="myframe" src="start.html" scrolling="no" marginwidth="0" marginheight="0"
  105.  
  106. frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:100%;
  107. display:none"></iframe>
  108.  
  109. </body>
  110. </html>


obrazki.html - tutaj bedzie lista obrazkow i po kliknieciu na nie chcialbym zeby na

stronie index.html wstawilo mi tekst(nazwe, id)
  1. <head>
  2. <title>Start</title>
  3. </head>
  4. <h3>Obrazki</h3>
  5. <a href="javascript:opener.dodaj_obrazek ('obrazek.jpg')">dodaj_obrazek</a>
  6. </body>
  7. </html>


Niestety na ta chwile mi to nie chce dzialac, sadze ze ma to zwiazek z tym ze na stronie obrazki.html nie zna(pamieta) juz strony ktora otwierala pop upa, bo wszystko ladnie dziaja jak klikne na linka na stronie stro.html.

Moglby mi ktos napisac jak wstawic tekst z obrazek.html do index.html?