Problems accessing document element.

33 views
Skip to first unread message

Iona

unread,
May 15, 2013, 9:49:20 PM5/15/13
to greasemon...@googlegroups.com
I'm relatively new to writing userscripts (I've never had any education on using javascript either) and I've run into a problem I just can't find a solution to so I was hoping you guys could help.

I'm trying to update http://userscripts.org/scripts/show/137137 this script to work as it should on firefox.

what it's supposed to do is grab the comment box (id="body") from inside the comment form (id="qrform") and insert text into it on button presses. Now it works fine on the reply pages http://simpleruser.dreamwidth.org/422.html?replyto=422 (ids are different there but it's not the reason as I have both options and it works on chrome) but it doesn't work on the quick reply forms on these pages http://simpleruser.dreamwidth.org/422.html

I believe this is because getElementById doesn't pick up hidden elements? 

If you need more or clearer information please ask.

Examples:

not working on ff with gm - 

working on chrome - 

working on ff with gm on reply to page - 

Iona

unread,
May 15, 2013, 10:01:59 PM5/15/13
to greasemon...@googlegroups.com
you may have to be logged into a dreamwidth account to not be redirected to the repyto page in the first place. Registration only takes a minute but perhaps won't be necessary to answer my question?

janekptacijarabaci

unread,
Jul 20, 2013, 3:01:24 AM7/20/13
to greasemon...@googlegroups.com
Hello, 
the comment box (id="body") is generated jquery. The treatment (for example) - see attached patch.

Dne čtvrtek, 16. května 2013 4:01:59 UTC+2 Iona napsal(a):
137137_1.js

Iona

unread,
Jul 21, 2013, 3:47:51 AM7/21/13
to greasemon...@googlegroups.com
Thank you very much for your help! Works wonderfully. Have made a note of your help c:
Reply all
Reply to author
Forward
0 new messages