왜이 함수에서 루트 경로가 두 배가됩니까? 여기 jQuery가 load() 함수에서 루트 경로를 두배로 늘림
function bodyClass(id) {
var catName = $('#location').children().eq(4).text(),
rootPar = ("http://localhost/site/" + catName),
banner = $('#wantedDiv'),
// this load variable doubles up the root path and does not escape the first single quote
content = $('<div />').load("'" + rootPar + " " + banner + "'", function(){
$('#placeDiv').prepend(content.html());
});
// console logging retrieves the correct path inclusing the added "catName"
console.log(rootPar);
}
bodyClass();
CONSOLE.LOG : http://localhost/site/page
부하() FUNC : GET http://localhost/site/ 'http://localhost/site/page' 404 (하지 않음 찾음)
작은 따옴표를 모두 제거하면 어떻게됩니까? –
다른 오류가 발생합니다.> 인식 할 수없는 표현식 : [object Object] ' – Sergio