worm32.... Posted November 2, 2013 Report Share Posted November 2, 2013 Cum schimb un value dintrun textbox dintr-o ferestra separata folosind js?Am incercat cu:var f=window.open('test.html');f.document.getElementById('name').value='asd';Dar primesc urmatoarea eroare[15:23:06.899] Empty string passed to getElementById().[15:23:07.309] TypeError: f.document.getElementById(...) is null @ Quote Link to comment Share on other sites More sharing options...
worm32.... Posted November 2, 2013 Author Report Share Posted November 2, 2013 up Quote Link to comment Share on other sites More sharing options...
eusimplu Posted November 2, 2013 Report Share Posted November 2, 2013 Sa-ti explic logica a ce ai dat tu:1. Deschid Fereastra noua2. Modific3. Fereastra s-a incarcatMai exact, inainte de toate asteapta sa se incarce fereastra. Pentru asta poti folosii event-ul onload.var f=window.open('test.html', 'vierme', 'width=100, height=100');f.onload = function(){ this.document.getElementById('name').value='asd';}Si apropo, sper ca stii ca ambele pagini trebuie sa iti apartina. Quote Link to comment Share on other sites More sharing options...
B7ackAnge7z Posted November 2, 2013 Report Share Posted November 2, 2013 Mai întâi de toate trebuie s? te asiguri c? pagina a fost înc?rcat?, ?i abia apoi execu?ii func?ia. Exemplu:var f = window.open('test.html');f.onload = function () { f.document.getElementById('name').value = 'asd';}; Quote Link to comment Share on other sites More sharing options...