2013-08-07 13 views
2


我试图改变这样的网址(http://www.rangde.org/gift-cards?theme=Anniversary
但我得到的输出是(http://www.rangde.org/gift-cards/?theme=Anniversary
我不想斜杠在问号参数前请帮我解决这个问题
我的脚本是在这里:如何在历史JS插件添加的,而不是正斜杠问号参数

History.pushState({state:1,rand:Math.random()}, 'Designs', '?theme=Diwali'); 
    function(){  
       var History = window.History, // Note: We are using a capital H instead of a lower h 
       State = History.getState(), 
       $log = $('#log'); 

       History.log('initial:', State.data, State.title, State.url); 

       History.Adapter.bind(window,'statechange',function(){ // Note: We are using statechange instead of popstate 

       var State = History.getState(); // Note: We are using History.getState() instead of event.state 
       History.log('statechange:', State.data, State.title, State.url); 
       }); 
      } 

回答

0

没有通过Histor.js或任何其他客户端脚本实现的......这应该在服务器端完成。

2

不知道是否错误或功能,但看起来像加入一个实际的URL查询帮助:

History.pushState({}, 'New title', window.location.pathname + "?" + ...); 
+0

这为我工作,但我需要修剪掉路径尾随“/” 。 – Feckmore

相关问题