javascript

자바스크립트에서 변수명을 일정하게 생성하기 위해서 eval을 열심히 사용했지만 선언되지 않은 변수라고 에러가 팍팍팍팍!!! 결국 구글링신의 힘을 빌려 알아낸 결과. window[] 라는 것을 알게 되었다. 역시 구글!!!! Today I was looking for a decent way to have variable variables in Javascript. Because I work with a whole bunch of particularly bright people*, the answer to any question is always near. I figured I'd share today's little insight! First let's look about how we'd do this i..
페이지 로딩시 시작할 스크립트 선언에 대해 의 onload를 많이 사용해 보았을 것입니다. 그리고 모든 페이지에서 공통으로 들어갈 스크립트는 페이지 마다 작성을 하지 않고, js 파일을 만들어 연결을 하여 사용을 할 것입니다. 여기서 그럼 모든 페이지에서 load시 공통으로 실행될 스크립트는 어떻게 작업을 할까요?? window.onload를 사용 하면 됩니다. window.onload = function(){ 시작시 실행될 내용 } 이런식으로 말이죠. 그런데 문제는 window.onload와 는 동시에 사용을 할 수 없습니다. 가 실행이 되면 window.onload는 실행이 되지 않는 문제가 있습니다. 그래서 이를 해결하고자 할때 사용하는 것이 window::onload()입니다. function w..
var type=navigator.appName if (type=="Netscape") var lang = navigator.language else var lang = navigator.userLanguage // 국가코드에서 앞 2글자만 자름 var lang = lang.substr(0,2) // 영어인 경우 if (lang == "en") window.location!.replace('english.html') // 독일어인 경우 else if (lang == "de") window.location!.replace('german.html') // 스페인어 인 경우 else if (lang == "es") window.location!.replace('spanish.html') // 위의 ..
JaeYa_Lee
'javascript' 태그의 글 목록