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


Groups > comp.lang.javascript > #35182

Reach js sourcefiles within other divs

Newsgroups comp.lang.javascript
Date 2018-06-06 16:45 -0700
Message-ID <30c8c35e-e10b-4746-8a0a-349db71396ac@googlegroups.com> (permalink)
Subject Reach js sourcefiles within other divs
From Jonas Thörnvall <jonas.thornvall@gmail.com>

Show all headers | View raw


I dynamically load HTML pages into divs each HTML file invoke some js sources, i now see that the canvas that was created by HTML and JS sources in a div called main is not reachable from a later loaded div and its source js files.

I was hoping having some files and functions reachable by any project i do, and not need to incorporate them in all projects by copy.

Uncaught ReferenceError: mainctx is not defined
    at tracks_canvas.js:1

So can i somehow refer to that the js files is loaded into another div, by just use its name?

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


Thread

Reach js sourcefiles within other divs Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-06 16:45 -0700
  Re: Reach js sourcefiles within other divs Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-06 16:55 -0700
    Re: Reach js sourcefiles within other divs Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-06 17:11 -0700
      Re: Reach js sourcefiles within other divs Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-06 17:45 -0700
        Re: Reach js sourcefiles within other divs Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-07 03:45 -0700
          Re: Reach js sourcefiles within other divs Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-07 03:55 -0700

csiph-web