1, JS
function relaunch (ID, service, submit) {varUsername = $ ("#id_username"). text (); /*if (Submit! = Username && Submit! = "Null") {Addalert ("Warning:" + "Permission Denied, only Your Private Deploy allowed to relaunch! "); return false; } */window.location='/deploynext/?type=redo&deploy_id='+id+'&service='+encodeURI (service); }
2. Python
from urllib Import Quote>>> quote (' warcraft ')'%c4% A7%ca%de'
3. Django Template
<ulclass="Dropdown-menu"> <!--<li><a href="/newjobbasic/">Basic</a></li> <li><a href="/newjobscript/">Script</a></li> <li><a href="/newjobplaybook/">Playbook</a></li> {% forIteminchTmp_keys%} <li><a href="/deploynext/?type=new&service={{item | urlencode}}">{{item}}</a></li> {% ENDFOR%} </ul>
Resources:
UrlEncode and UrlDecode in Python:http://blog.csdn.net/haoni123321/article/details/15814111
Web Javascript, Python, Django templates work with URL Encode