function displayinfo(){ var di = (screen.width +"x"+ screen.height); if(di == '1280x1024'){ function r100() {alert("1");} function r200() {alert("2");} } else if(di == '12ss80x1024'){ function r100() {alert("3");} function r200() {alert("4");} } else if(di == '12s80x1024'){ function r100() {alert("5");} function r200() {alert("6");} } else{ alert("1"); }
Przy załadowaniu strony sprawdzam rozdzielczość ekranu poprzez funkcje displayinfo(), jednak chciałbym za pomocą np. linku odwołać się do funkcji r100() która jest zależna od if z pobraną rozdzielczością ekranu, jak mam to zrobić?