Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #36139 > unrolled thread
| Started by | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| First post | 2019-03-20 11:17 -0700 |
| Last post | 2019-03-20 11:32 -0700 |
| Articles | 2 — 1 participant |
Back to article view | Back to comp.lang.javascript
Setting window "frame" in focus Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-03-20 11:17 -0700
Re: Setting window "frame" in focus Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-03-20 11:32 -0700
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2019-03-20 11:17 -0700 |
| Subject | Setting window "frame" in focus |
| Message-ID | <60b24555-0ee3-4602-b617-5b44d382af98@googlegroups.com> |
My script loads two frames, in the main frame "first loaded" there is a character key listener. Unfortunately after the other frame loaded it seem that the main frame no longer in focus. So i tried to figure out howto set it in focus without point into frame with mouse?
I've tried to point to elements inside frame to get focus to window
document.getElementById("someElement").focus();
Gives...Uncaught TypeError: Cannot read property 'focus' of null
And tried to point to frame **name**
myframe.focus();
Uncaught ReferenceError: testing is not defined
[toc] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2019-03-20 11:32 -0700 |
| Message-ID | <7412da2e-98fe-4466-ac2f-14873ea38dc9@googlegroups.com> |
| In reply to | #36139 |
Den onsdag 20 mars 2019 kl. 19:17:53 UTC+1 skrev Jonas Thörnvall:
> My script loads two frames, in the main frame "first loaded" there is a character key listener. Unfortunately after the other frame loaded it seem that the main frame no longer in focus. So i tried to figure out howto set it in focus without point into frame with mouse?
>
> I've tried to point to elements inside frame to get focus to window
> document.getElementById("someElement").focus();
> Gives...Uncaught TypeError: Cannot read property 'focus' of null
>
>
> And tried to point to frame **name**
> myframe.focus();
> Uncaught ReferenceError: testing is not defined
Solved using parent.myframe.focus();
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.javascript
csiph-web