2012-03-24 7 views
0

でそれをデコードし、私はこれは、サーバーが見ているものであるencodeURIComponentでを使用してサーバ側

http://www.regis.edu/regisgpcd.asp?sctn=cpedcn&p1=ap&p2=EDFD&p3=cd3Dcd&_=1332612418587 

のようにサーバにencodeURIComponentでを使用してリクエストパラメータの一部としてURLを送っ:

http://www.regis.edu/regisgpcd.asp?sctn=cpedcn&p1=ap&p2=EDFD&p3=cd 

私が持っていたとはいえencodeURIcomponentを使用してデータベースに再度挿入しましたが、データベースに見つかりませんでした。

このURLは、次のような形式ですが、encodeURIcomponentの後に挿入しました。私はそれを列に挿入する前に、通常の種類に変換したと思います。

http://www.regis.edu/regisgpcd.asp?sctn=cpedcn&p1=ap&p2=EDFD&p3=cd 

どうすれば問題を解決できますか?何か案が?

これは私の挿入コードです:私は、サーバー上の文字列をデコードを経由して、その問題を解決

$.ajax({ 
       type : "GET", 
       url : '/tree/deleteResult/?title='+encodeURIComponent(title)+"&url="+encodeURIComponent(url), 
       cache : false, 
       success : function(res) { 
        if(res == "F") //if F is returned from server it means "There is a folder with same name" 
         notification("Operation Failed", "Bookmark cannot be deleted! Sorry :("); 
        else 
         notification("Operation Succeed", "Bookmark've been deleted.");  
         deleteResult(domObj); 
       }, 
       error : function(x, y, z) { 
        alert(x.responseText); 
       } 
      }); 
     } 
+0

jquery ajaxを使っていますか? – Engineer

+0

はい私はそれを使用しています – erogol

+0

あなたのajax設定オブジェクトに 'cache:false'を設定しようとしました。 – Engineer

答えて

0

$.ajax({ 
        type : "GET", 
        url : '/tree/insertResult/?url=' + encodeURIComponent(url) + '&title=' + encodeURIComponent(title)+'&folder='+folderName+'&snippet='+encodeURIComponent(snippet), 
        cache : false, 
        success : function(res) { 
         if(res == "F") 
          notification("Operation Failed", "You have that bookmark in that folder!"); 
         else{ 
          folderName = res; 
          notification("Operation Suceeded", "Bookmark has been created."); 
          updateFolderContent(url, title, folderName, snippet);//it is in _filetree_javascript.html.erb 
         } 
        }, 
        error : function(x, y, z) { 
         alert(x.responseText); 
        } 
       }); 
      } 

これは私のコードを取得しています。私はレールでCGI宝石を使った。

CGI::unescapeHTML(url) 
関連する問題