1、JS

function relaunch(id, service, submit) {
            var username = $("#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('魔兽')
'%C4%A7%CA%DE'

3、Django模板

<ul class="dropdown-menu">
                                            <!-- <li><a href="/newJobBasic/">Basic</a></li>
                                            <li><a href="/newJobScript/">Script</a></li>
                                            <li><a href="/newJobPlaybook/">Playbook</a></li> -->
                                                {% for item in tmp_keys %}
                                                    <li><a href="/deployNext/?type=new&service={{item | urlencode}}">{{item}}</a></li>
                                                {% endfor %}
                                        </ul>

 

参考资料:

python中的urlencode与urldecode :http://blog.csdn.net/haoni123321/article/details/15814111

 

相关文章:

  • 2021-12-24
  • 2022-02-14
  • 2021-09-07
  • 2021-06-05
  • 2021-06-26
  • 2021-04-02
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-03
  • 2022-12-23
  • 2022-12-23
  • 2021-11-25
  • 2021-07-16
  • 2022-12-23
  • 2021-11-28
相关资源
相似解决方案