0
문제가 있습니다.URL 검색어 매개 변수
나는 노드와 표현을 사용하고 있습니다. Index.html
에는 2 개의 입력이 있습니다.
router.get('/profile', function(req, res){
var var1 = req.params.variable1;
var var2 = req.params.variable2;
res.render('result');
}
노드가 result.html
을 렌더링,하지만 난 얻을 URL이 질문은 어떻게 URL 대신 https://localhost:3030/profile/xxx/yyy
를 얻을 수
https://localhost:3030/profile?variable1=xxx&variable2=yyy
입니다 :
<form action="/profile" method="get"> <input id="variable1" name="variable1" type="text" placeholder="..."> //xxx Select : <select id="variable2" name="variable2"> <optgroup label="y"> <option value="variable">yyy</option> </select>
는
profile.js
에 내가있어 위?
내가 직접 처리 할 수 없기 때문에 질문을 편집했습니다. ( – BaSic
@BaSic 도움이되는 경우 업데이트 된 답변을 확인하십시오. –
아직 없습니다. 그것은 여전히 https : // localhost : 3030/profile? variable1 = xxx & variable2 = yyy이기 때문에 아마 index.html에있는 것일 것입니다. – BaSic