阅读:1916回复:3
网页小书签求助
自己制作了一个中国译典的网页小书签,但是不能查中文,求帮助。谢谢!
网址:http://www.tdict.com/ javascript:q%20=%20""%20+%20(window.getSelection%20?%20window.getSelection()%20:%20document.getSelection%20?%20document.getSelection()%20:%20document.selection.createRange().text);%20if%20(!q)%20q%20=%20prompt("\u8BF7\u8F93\u5165\u641C\u7D22\u7684\u5173\u952E\u8BCD:");%20if%20(q!=null)%20{var%20qlocation=('http://www.tdict.com/default.asp?word=all&word2=-1&username=&type=1&InResult=&IsResult=0&key='%20+%20q);window.open(qlocation);}%20void%200 |
|
1楼#
发布于:2013-04-02 18:17
javascript:q = "" + (window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text); if (!q) q = prompt("\u8BF7\u8F93\u5165\u641C\u7D22\u7684\u5173\u952E\u8BCD:"); if (q!=null) {var qlocation=('http://www.tdict.com/default.asp?word=all&word2=-1&username=&type=1&InResult=&IsResult=0&key=' + escape(q));window.open(qlocation);} void(0); 用escape函数编码;下次记得发Code代码格式;用弹出窗口的方式略渣 |
|
2楼#
发布于:2013-04-02 18:17
谢谢楼上。
|
|
3楼#
发布于:2013-04-02 18:17
1 2 3 4 5 6 7 8 9 10 javascript : q = "" (window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text); if (!q) { q = prompt("\u8BF7\u8F93\u5165\u641C\u7D22\u7684\u5173\u952E\u8BCD:"); } if (q != null) { var qlocation = ('http://www.tdict.com/default.asp?word=all&word2=-1&username=&type=1&InResult=&IsResult=0&key=' escape(q)); window.open(qlocation); } void (0); |
|
|