'/image.htm?diskindex=0&diskcount=2&sortby=0&view=0&imagefilter=1&sizemore=1'
という文字列全体をactiondownloadsingle.htm
のパラメータとして渡したいと考えています。JavaScriptのURLのパラメータとしてURLアドレス文字列を渡すにはどうすればいいですか?
文字列をエンコードするために関数encodeURIを使用しようとしましたが、失敗しました。サーバークライアントでパラメータorigurlの正しい値を取得できません。どうすればよいですか?ありがとう!
$('.CssDownloadSingle').click(function() {
var fileName = GetHiddenFilename(this);
var origurl ='/image.htm?diskindex=0&diskcount=2&sortby=0&view=0&imagefilter=1&sizemore=1'
location.href = "actiondownloadsingle.htm?origurl=" +encodeURI(origurl);
});
あなたの質問に回答され、[ここ](http://stackoverflow.com/questions/1737935/ javascriptのように推奨されるway-to-pass-urls-as-url-parameters) ショートカット:encodeURIComponent()を使用 –