/    Sign up×
Community /Pin to ProfileBookmark

Is that possible – attract attention to window without using window.focus

i wrote this question another forum but no lock:

First of all, im not a pro on js, im trying to do something by using it.

I really wonder, is that possible to warn user without using window.focus ?

I just dont know the rigth word, i try to explain.

You were writing a message to someone by using an instant messaging program (like msn), and u wanted to open another program. So when u opened new program the the conversation window lost focus. At that time if the other chatter sends a new message, the window warns u, by using colors (etc windows xp uses blue as default). But the window doest get focus, i mean it doesnt try to be on top.

Could it be possible by using js?

I hope i could explain..

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@rootJun 25.2007 — under windows, the group or task bar should flash a button to indicate something new or a change has taken place in one of the grouped buttons in the taskbar.
Copy linkTweet thisAlerts:
@AndyArmstrongJun 25.2007 — I dont think so.

The javascript API willnot allow you to edit anything other than whats on the window in front of you. It may allow you to set focus on individual elements on the page.
Copy linkTweet thisAlerts:
@itsnavigatorauthorJun 26.2007 — under windows, the group or task bar should flash a button to indicate something new or a change has taken place in one of the grouped buttons in the taskbar.[/QUOTE]

soo, are the programs being able to interfere this? So i guess so, but i dont know it is possible or not on js. because instant messaging programs are being able to do this.


I dont think so.

The javascript API willnot allow you to edit anything other than whats on the window in front of you. It may allow you to set focus on individual elements on the page.[/QUOTE]


"It may allow you to set"... what are the limits of js?

Thanx for ur interesting
Copy linkTweet thisAlerts:
@rootJun 26.2007 — No, the programs cant do anything, it is the operating system that flashes the task bar button or group button, you have no control over it for security reasons.

All I can say is fill your task bar up with programs and experiment with your broswer script.
Copy linkTweet thisAlerts:
@AndyArmstrongJun 26.2007 — There is not much you can do, apart from close window, open a new window, or MAYBE minimize etc, javascript is not allowed and wasnt designed to do anything out of a browser window.
Copy linkTweet thisAlerts:
@Logic_AliJun 26.2007 — I think the only visual warning JS can produce is to flash text in the title bar.

You could use this code to do it, perhaps using the window's [I]onfocus[/I] event to reset it:
[CODE]<body>
<script type='text/javascript'>

TitleWarn=
{
defTitle:top.document.title,
timer:null, warnText:"", state:0,

start:function(text, period)
{
this.period=Math.max(period,800);

this.warnText=text;

this.timer=setInterval("TitleWarn.blink()", period);
return false;
},

stop:function()
{
clearInterval(this.timer);
top.document.title=this.defTitle;
return false;
},

blink:function()
{
top.document.title=(this.state^=1) ? this.warnText : this.defTitle;
}
/*28432973637269707465726C61746976652E636F6D*/

}
</script>

<a href='#' onclick='return TitleWarn.start(">>New Message<< ", 1000)'>WARN</a>
<a href='#' onclick='return TitleWarn.stop()'>RESET</a>

</body>[/CODE]
×

Success!

Help @itsnavigator spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...