W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2011

[whatwg] Run javascript code once

From: Diogo Resende <dresende@thinkdigital.pt>
Date: Thu, 31 Mar 2011 12:53:39 +0200
Message-ID: <d1a77247f0a0aa923cc837d3bfb19b43@thinkdigital.pt>
 Hi,

 I would like your opinion on this use case:

 I have an app divided in several modules, each one has a javascript 
 code that needs to run to show the module page and init the 
 interactions. The app is not supposed to reload to show each module.

 What is the best way to fetch the javascript code and run it? Add a 
 <script> for that module and remove it when switching to another module? 
 Download using AJAX or other technology and use eval()?

-- 
 Diogo
Received on Thursday, 31 March 2011 03:53:39 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:31 UTC