Lester Caine wrote:
At the risk of being shouted at because *I* know it's not a PHP problem!
I have a page that is being refreshed every 30 seconds or so, and
displays a list of 'tickets' waiting to be dealt with on a list from a
database query. No problems there, but a couple of sites now want me to
add a pop-up warning when a ticket is added that has a staff ID matching
the logged in user.
I can drive a sounder in the target browser, but need kicking in the
right direction for a method of adding a pop-up window. Ideally it needs
to be browser agnostic, which is where the problem comes given the
pop-up blockers and other 'toys' that are being added to the browser end
of things.
So can anybody point me in the right direction for a CURRENT method of
achieving this, many of the bits I've found so far are somewhat
antiquated, and fail in one way or another :(
I don't know about 'CURRENT' but you have atleast 3 options:
1. if its an intranet app then just tell them they have to add the intranet server
to a trusted zone (and that the browser should allow popups
2. dump your popup info in an absolutely positioned div and make the layer
visible on top of the rest of the page (with a js link that hides the layer again)
3. use a js alert(), which you might consider ugly... BUT its modal, its not blockable
(other than if js is turned off completely!) -- a user is therefore forced to read the
alert and click OK in order to continue.
if you want to do something that is triggered by page onload() then you can use this
function to add the handler to the document.onload event without breaking any other
js code (functions) which have already been 'attached' to the onload event:
function joinFunctions()
{
var newfunc = '';
for (var c = 0;c < arguments.length;c++) {
if ( arguments[c] ) {
var func=arguments[c].toString();
newfunc+=func.substr(func.indexOf("{")-1);
}
}
return new Function(newfunc);
}
example:
window.onload = joinFunctions(
window.onload,
function() { alert('Hey User you have been assigned some new tickets!'); }
);
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php