Using Javascipt to count number of times a code is run
However I don't want the webpage to open in the users machine as this will be really annoying for the user.
Does anyone have any suggestions on how to do this? or if you can think of a better way to complete the overall goal.
Any help would be really appreciated!!
Are you working with a server language? If so, which one?
Thanks so much for getting back to me. Sorry for omitting these key details in my original post.
On right click the extension provides short cuts to a series of other web applications.
Please let me know if more information is required here.
You could create an invisible iframe or create a script element. Then change the src to your server-side script that counts usage.
Sorry I'm a bit of a newbie to this stuff.
Does an I-Frame not have to still sit within an existing html page meaning that a html page would still have to be opened in the user's browser?
I'm sure that as soon as I post this, someone will prove me wrong, but I don't see how you can use a page as the counting mechanism as you suggest. It seems to me that the only way to do that would be to make the page do nothing but redirect to another target, in which case it functions merely as a pass-through and won't show to the user. The key there is, you have to be in the process of redirecting them to another page. It doesn't sound like that's what's happening, unless that's happening when they click on one of the links for the "other web applications". That's how it appears to me.
There are other options, but they depend on your having access to a server side language. You must have a server involved, since you're able to serve up the counting page. If you can run a server language page there, e.g. ASP or PHP, you'd have a lot of options available to you for gathering a count. You could run an Ajax request to the page and update a counter somewhere, either in a text file, or a database.
This will not be possible in this situation since most requests would be cross domain.
You could run an Ajax request to the page and update a counter somewhere, either in a text file, or a database.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)