Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #30281

Ctrl + onload

From emf <emfril@gmail.com>
Newsgroups comp.lang.javascript
Subject Ctrl + onload
Date 2016-04-15 01:34 -0400
Organization Aioe.org NNTP Server
Message-ID <nepuha$19br$1@gioia.aioe.org> (permalink)

Show all headers | View raw


In eye exercise #4, I would like to change this

window.onload = function () {
     "use strict";
     var text = "text1.txt";
     textFile(text);
     document.getElementById("start").onclick = function () {
         requestFullScreen();
         init();
     };
};

so that when you open the window while pressing Ctrl (or maybe the "2" 
key) text2.txt instead of text1.txt is assigned to text. Is this possible?

I do not want to use a checkbox or radio buttons.

BTW, textFile(text); has to be executed onload, it cannot be executed 
onclick -- I tried it out and it doesn't work. (Though I guess I could 
have both text files read in 2 different arrays, in which case I might 
select one of the other by pressing Ctrl while clicking the Start button...)

BTW, this exercise does not work in Internet Explorer -- something I co 
not consider crucial. I am wondering, though, about Edge...

-- 
The folk oratorios of Mikis Theodorakis
http://emf.neocities.org/mt/folkoratorios.html

Back to comp.lang.javascript | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Ctrl + onload emf <emfril@gmail.com> - 2016-04-15 01:34 -0400
  Re: Ctrl + onload emf <emfril@gmail.com> - 2016-04-18 22:13 -0400
    Re: Ctrl + onload Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-04-19 19:46 +0200
      Re: Ctrl + onload Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-04-26 02:55 +0200

csiph-web