0

次のデコードされたスクリプトが機能しないのはなぜですか? 元のコードは問題なく動作するようです。

javascript:(function(s){try{s=document.selection.createRange().text}catch(_)  {s=document.getSelection()}prompt('State the question and answer below.','Q.' s '')})

元のコード:

javascript:%28function%28s%29%7Btry%7Bs=document.selection.createRange%28%29.text%7Dcatch%28_%29%7Bs=document.getSelection%28%29%7Dprompt%28%27State the question and answer below.%27,%27Q.%27+s+%27%27%29%7D%29%28%29

よろしくお願いします。

4

2 に答える 2

1

+記号をスペースにデコードしました。これを試してください:

javascript:(function(s){try{s=document.selection.createRange().text}catch(_)  {s=document.getSelection()}prompt('State the question and answer below.','Q.'+s+'')})

違い:' s 'これに変更'+s+'

于 2013-03-22T11:30:08.043 に答える
0

+ 記号をアンエスケープして () を末尾に追加しないでください。

javascript:(function(s){try{s=document.selection.createRange().text}catch(_)  {s=document.getSelection()}prompt('State the question and answer below.','Q.' s '')})
should be
javascript:(function(s){try{s=document.selection.createRange().text}catch(_){s=document.getSelection()}prompt('State the question and answer below.','Q.'+s+'')})()
于 2013-03-22T11:30:55.330 に答える