07/10/13 06:30:59
Javascriptを勉強し始めたばかりのものですが
↓の様なブックマークレットを見つけたのですが
javascript:void(function(){var%20q=(document.all)?document.selection.createRange().text:document.getSelection();
if(!q){void(q=prompt('Google検索',''));}if(q){location.href=('URLリンク(www.google.com)'+q.replace(/_/g,'-'));}})()
if(!q)の!って何ですか?
あと
javascript:var%20q=document.getSelection();if(!q){q=prompt('Google検索','')}if(q){location.href=('URLリンク(www.google.com)'+q);}
といろいろと削っても動いたのですがもしかして問題があったりしますか?
まだJavascriptをいろいろと勉強し始めて二日と立ってないので
変な質問してるかもしれませんがよろしくお願いします