Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #31654
| Newsgroups | comp.lang.javascript |
|---|---|
| Date | 2016-11-07 14:23 -0800 |
| References | <5c66e503-f057-4113-ae7a-d177d882b78c@googlegroups.com> <581eee8e$0$857$e4fe514c@news.xs4all.nl> <e8a3ad62-b789-48c2-b0a8-ef77a0bab0a8@googlegroups.com> <581f749e$0$881$e4fe514c@news.xs4all.nl> <XnsA6B963CDAFB85eejj99@194.109.6.166> |
| Message-ID | <0aecf8a3-3bda-41f9-8169-0401e2771dc4@googlegroups.com> (permalink) |
| Subject | Re: What's an efficient way to record the number of loading / calling of a JS script file? |
| From | justaguy <lichunshen84@gmail.com> |
On Monday, November 7, 2016 at 3:48:44 AM UTC-5, Evertjan. wrote:
> Luuk <luuk@invalid.lan> wrote on 06 Nov 2016 in comp.lang.javascript:
>
> >> The other thing is i've disabled web server log. Thanks tho.
> >
> > The most efficient way to record how many time a client has initiated a
> > load for that script (which is my interpretation of your question), is
> > to enable server side logging.
>
> Which will also accomodate for not counting the possible clientside re-use
> of a cashed version.
>
> Using classic ASP:
>
> // js-file content here, call this file "myJS.asp"
> <%@ Language="JScript" %>
> <%
> var ForReading = 1, ForWriting = 2, count, f;
> var filename = Server.MapPath("count-myJS-asp.txt");
> var fso = new ActiveXObject("Scripting.FileSystemObject");
>
> if (fso.FileExists(filename)) {
> f = fso.OpenTextFile(filename, ForReading);
> count = f.ReadAll();
> f.Close();
> } else {
> var f = fso.CreateTextFile(filename, true);
> f.Close();
> count = 0;
> };
>
> f = fso.OpenTextFile(filename, ForWriting);
> // count = -1; // reset counter to 0
> f.Write(++count);
> f.Close();
> %>
> ================
>
> Read the number into an html-file:
>
> <iframe src = 'count-myJS-asp.txt'> </iframe>
>
>
I appreciate it though I'm not an ASP developer.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
What's an efficient way to record the number of loading / calling of a JS script file? justaguy <lichunshen84@gmail.com> - 2016-11-05 14:35 -0700
Re: What's an efficient way to record the number of loading / calling of a JS script file? Luuk <luuk@invalid.lan> - 2016-11-06 09:49 +0100
Re: What's an efficient way to record the number of loading / calling of a JS script file? justaguy <lichunshen84@gmail.com> - 2016-11-06 06:42 -0800
Re: What's an efficient way to record the number of loading / calling of a JS script file? Luuk <luuk@invalid.lan> - 2016-11-06 19:21 +0100
Re: What's an efficient way to record the number of loading / calling of a JS script file? justaguy <lichunshen84@gmail.com> - 2016-11-06 12:33 -0800
Re: What's an efficient way to record the number of loading / calling of a JS script file? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-11-07 09:48 +0100
Re: What's an efficient way to record the number of loading / calling of a JS script file? justaguy <lichunshen84@gmail.com> - 2016-11-07 14:23 -0800
Re: What's an efficient way to record the number of loading / calling of a JS script file? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-11-07 23:51 +0100
Re: What's an efficient way to record the number of loading / calling of a JS script file? justaguy <lichunshen84@gmail.com> - 2016-11-08 08:01 -0800
Re: What's an efficient way to record the number of loading / calling of a JS script file? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-11-08 19:19 +0100
Re: What's an efficient way to record the number of loading / calling of a JS script file? JJ <jj4public@vfemail.net> - 2016-11-06 20:31 +0700
Re: What's an efficient way to record the number of loading / calling of a JS script file? justaguy <lichunshen84@gmail.com> - 2016-11-06 06:44 -0800
csiph-web