나는 이런 식으로 뭔가 도달하고자하는 일치 jQuery를하는 경우 :URL이
if(window.location.href.indexOf("http://stackoverflow.com/questions/")){
... then to this
}
을하지만 URL이 http://stackoverflow.com/questions/ask/
나는 이런 식으로 뭔가 도달하고자하는 일치 jQuery를하는 경우 :URL이
if(window.location.href.indexOf("http://stackoverflow.com/questions/")){
... then to this
}
을하지만 URL이 http://stackoverflow.com/questions/ask/
처럼 보이는 경우 여전히 실행 당신은 URL을 확인하는 정규식을 요구하고 있는가? – OlivierLi
IF 조건이 어쨌든 유효하지 않습니다.해야 할 일 : if (window.location.href.indexOf ("http://stackoverflow.com/questions/")> -1) { ... this to this this } –
indexOf()의 가능한 반환 값을 조사하고 싶을 것입니다. – kinakuta