You need to be logged in to post in the forums. If you do not have an account, please sign up first.
Need help on search typed text with javascript
Previously there is a JavaScript that allow me to search typed text without using clipboard content, but it's been broken since 10.5x... http://my.opera.com/community/forums/topic.dml?id=265522Is there anyway to fix this JavaScript so that I can use it on 10.54?
Go to page, "javascript: window.open('http://www.answers.com/'+encodeURIComponent(document.selection.createRange().text)).blur();"
Thanks for any help.
Replace
on
document.selection.createRange().text
on
function(){var d=document,s=d.getSelection(),t=d.querySelectorAll('textarea,input[type=\x22text\x22]');if(!s)for(var i=0,e;e=t[i];i++){if(s=e.value.substring(e.selectionStart,e.selectionEnd))break}return s}()
I wonder what did they changed
http://my.opera.com/sitepatching/blog/2010/02/01/browser-js-for-10-5-the-giant-cleanup-2
«Removed - zhangmen.baidu.com textarea typing - we supported IE's document.selection object without full support for the IE selection APIs. This site (and some others) would detect document.selection and assume the entire API existed. In 10.5 we fix this by removing document.selection support.»