リンクから URI エンコーディングを削除しようとしていますが、decodeURI が完全に機能していないようです。
私のリンク例は次のとおりです。/linkout?remoteUrl=http%253a%252f%252fsandbox.yoyogames.com%252fgames%252f171985-h-a-m-heroic-armies-marching
JavaScript スクリプトを実行すると、次のようになります。
http%3a%2f%2fsandbox.yoyogames.com%2fgames%2f171985-h-a-m-heroic-armies-marching
URI に残っている正しくないコードを取り除くにはどうすればよいですか?
私のデコードコード:
var href = $(this).attr('href'); // get the href
var href = decodeURI(href.substring(19)); // remove the outgoing part and remove the escaping
$(this).attr('href', 'http://'+href) // change link on page