>> Try this:
>> https://sites.google.com/site/sarittechworld/track-client-windows
>> > I am trying
>> > to prevent or warn a user from visiting a page he already has open and
>> > running/displayed in a separate browser window.
Thanks Maureen, It got me steered in the right direction. I am not an
expert on (anything?) JavaScript so I was unaware that modern browsers now
have a window.name object that will be blank until set. With that knowledge
and the fact that I am trying to protect the user from himself and the
functionality requires JavaScript it was much easier than I expected. With
some "appropriated code" I was able to set it for use in the other functions
(Plupload) to send back form data to the server with a suitable UUID for
tracking at the server level.
Like so:
var guid = uuid();
function uuid()
{
var chars = '0123456789abcdef'.split('');
var uuid = [], rnd = Math.random, r;
uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
uuid[14] = '4'; // version 4
for (var i = 0; i < 36; i++)
{
if (!uuid[i])
{
r = 0 | rnd()*16;
uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r & 0xf];
}
}
return uuid.join('');
}
$(document).ready(function(){
//-- guarantees that window.name is a GUID, and that it would
//-- be preserved whilst this window's life is open
window.name = guid;
//-- do all the other stuff here
// end of document ready function
});
Now I could access the window.name in other scripting functions for a
"unique" ID for the page that the server could track.
Dennis Powers
UXB Internet - A website Design and Hosting Company
P.O. Box 6028, Wolcott, CT 06716 - T:203-879-2844
W: http://www.uxbinternet.com
W: http://www.ctbusinesslist.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358811
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm