Document.getElementById ?
-
on a mac, both of these work...
is that the same on other PC variants...d.execute_script %Q(document.getElementById('trans_L8').value='Translate';)d.execute_script %Q(trans_L8.value='Translate';)john
-
Well, it's something basic one expects from all browsers to work. Not a question of operating system.
But I usedocument.getElementByIda lot (or frameworks using it) and it works, in IE, even the old IE6.
Whether you can use.value=depends on what type of element you access (HTMLInputElement?). -
the question is about the shorthand access inside a Webdialog, so WebKit v IE...
I find it cleaner without document string element...
and when generating dynamically the files smaller, so should be faster?
so, to rephrase, can IE handle the shorthand for any attribute, value/name/title etc...
john
-
My quick test with Sketchup v2014, IE 11 shows that both forms work. Have no information about other versions.
-
cheers Gábor,
I have a lot of them and the shorter the better...
john
-
@driven said:
cheers Gábor,
I have a lot of them and the shorter the better...
john
I've entered the following lines in to the ruby console for the test:
` dlg = UI::WebDialog.new("TEST", true,"TEST", 739, 641, 150, 150, true);#UI::WebDialog:0xb4e49d8
dlg.set_html('<html><head></head><body><div id="trans_L8"></div></body></html>')
nil
dlg.show
true
dlg.execute_script %Q(document.getElementById('trans_L8').innerHTML='Long';)
true
dlg.execute_script %Q(trans_L8.innerHTML='Short';)
true`
If somebody wants to try it with other version combinations... -
or select all...
dlg = UI;;WebDialog.new("TEST", true,"TEST", 739, 641, 150, 150, true); dlg.set_html('<html><head></head><body><div id="trans_L8"></div></body></html>') dlg.showdlg.execute_script %Q(document.getElementById('trans_L8').innerHTML='Long';)dlg.execute_script %Q(trans_L8.innerHTML='Short';)on mac you need to split it twice... but I know it works on mac...lol
john -
Thank you for the formatting. The splitted version works on PC, IE11, SU 2014.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register LoginAdvertisement