0
我有一個URL如下在url.pathname解析路徑名()
localhost:1340/promotionDetails/pwd1/pwd2?promotion_id=PROM008765
我用URL模塊,用於解析所述URL用於下面的路徑名是代碼
var url=require('url').parse('http://localhost:1340/promotionDetails/pwd1/pwd2? promotion_id=PROM008765', true).pathname
console.log(url);
的輸出,我得到的是
/promotionDetails/pwd1/pwd2
我用split函數來從path.I的pwd1和pwd2想知道是否有任何其它的方式來獲得pwd1和pwd2,而不使用拆分功能。任何幫助都將非常有幫助。
我想你沒有使用PHP – 2013-03-11 05:53:13
是的,我不使用PHP – 2013-03-11 06:36:14
你可以很容易地採用分體式pwd1和pwd2。那有什麼害處? – user568109 2013-03-11 11:49:07