473,763 Members | 9,275 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can the "header" of a JavaScript dialogue box be changed?

When JavaScript writes out a dialogue box (like when confirm() is called)
the header or title of that dialogue box shows up as "JavaScript
Application"... Can this title be changed so that maybe you could stick the
name of your application in it?
Jul 23 '05 #1
8 11576
"Chris Markle" <cm*****@sendma il.com> skrev i meddelandet
news:GVwud.7420 45$8_6.299280@a ttbi_s04...
When JavaScript writes out a dialogue box (like when confirm() is called)
the header or title of that dialogue box shows up as "JavaScript
Application"... Can this title be changed so that maybe you could stick the name of your application in it?


No.

Joakim Braun
Jul 23 '05 #2
It'd be some fancy DHTML, but you could use an absolutely positioned
DIV tag to simulate a window and put a nested DIV inside it for the
title along with some text and buttons.

Jul 23 '05 #3
<html>
<head>
<title>test</title>
<script>

//Create a MessageBox class
function MessageBox(){
var Callback;

this.Show=
function(title, text, callback){

//Setup the event handler
this.Callback = callback;

//Set the text and show it
var h = window.document .getElementById ("ConfirmTitle" );
h.innerHTML = title;
h.parentNode.st yle.display="bl ock";
window.document .getElementById ("ConfirmText") .innerHTML = text;

Callback = callback;
}

this.Hide=
function(result ){
var dv =
window.document .getElementById ("ConfirmTitle" ).parentNode;
dv.style.displa y="none";
var s = Callback + "('" + result + "');";
eval(s);
}

this.AddToPage=
function(){

//Assemble a dialog and add it to the page
var i=0; var sb = new Array();
sb[i++]="<DIV style=\"font-family:sans-serif;display:n one;
position:absolu te;left:100px;" ;
sb[i++]="top:100px; width:200; border:solid 1px gainsboro;\">";
sb[i++]="<H5 id=\"ConfirmTit le\"
style=\"backgro und-color:navy;colo r:white;\"></H5>";
sb[i++]="<P id=\"ConfirmTex t\"></P>";
sb[i++]="<input type=\"button\" value=\"yes\"
onclick=\"Msgbo x.Hide('yes');\ ">";
sb[i++]="<input type=\"button\" value=\"no\"
onclick=\"Msgbo x.Hide('no');\" >";
sb[i++]="</DIV>";
document.write( sb.join(""));
}
this.AddToPage( );
}

//Instantiate the Msgbox
var Msgbox = new MessageBox();
//Your function to do something with the result
function ResultHandler(r esult){
alert(result);
}

</script>
</head>
<body>
<A onclick="Msgbox .Show('Applicat ion Title','Text of the message
goes here... ','ResultHandle r');" href="#" > Show Message </A>
</body>
</html>

Jul 23 '05 #4
Hi,

Chris Markle wrote:
When JavaScript writes out a dialogue box (like when confirm() is called)
the header or title of that dialogue box shows up as "JavaScript
Application"... Can this title be changed so that maybe you could stick the
name of your application in it?


You can't, but you can (and should) use a pop-up for this:

http://www.galasoft-lb.ch/myjavascri...000090401.html

The confirm, alert and input message boxes were never designed for user
interaction, only for debug purposes.

HTH,

Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch

Jul 23 '05 #5
Ivo
"Laurent Bugnion" wrote
Chris Markle wrote:
Javascript confirm call outputs a dialogue box that writes out a message
and gives two choices: OK and Cancel. Can those buttons be relabelled
say to "Yes" and "No"? You can't, but you can (and should) use a pop-up for this:


Yes, the other post was an exact copy. Was that necessary? So once again:
Another, perhaps even nicer solution is to use a pop-in, a <div> or <iframe>
or so with your own buttons which you show and hide at will, at the same
covering the page to temporarily disable interaction. This solves all
problems with pop-up blockers and no resources are wasted on a whole new
window.
The confirm, alert and input message boxes were never designed for
user interaction, only for debug purposes.


Their original purpose is as relevant as the next thing. Those message boxes
are extremely useful and useable and I am sure many end users, from geeks to
total newbies, appreciate their lightweightness , straightforward ness and
absolute clarity to the point where even the buttons *always* read the same
thing.
--
Ivo
http://www.yorick.onlyfools.com/


Jul 23 '05 #6
Hi,

Ivo wrote:
"Laurent Bugnion" wrote
Chris Markle wrote:
Javascript confirm call outputs a dialogue box that writes out a message
and gives two choices: OK and Cancel. Can those buttons be relabelled
say to "Yes" and "No"?
You can't, but you can (and should) use a pop-up for this:

Yes, the other post was an exact copy. Was that necessary?


If the OP feels the need to post two copies (almost) of a message, one
can reasonably expect that he will look for answers to both. Especially
in this case, where it's obvious that it's not an error. And anyway, why
does it matter to you?
So once again:
Another, perhaps even nicer solution is to use a pop-in, a <div> or <iframe>
or so with your own buttons which you show and hide at will, at the same
covering the page to temporarily disable interaction. This solves all
problems with pop-up blockers and no resources are wasted on a whole new
window.


I agree.
The confirm, alert and input message boxes were never designed for
user interaction, only for debug purposes.

Their original purpose is as relevant as the next thing. Those message boxes
are extremely useful and useable and I am sure many end users, from geeks to
total newbies, appreciate their lightweightness , straightforward ness and
absolute clarity to the point where even the buttons *always* read the same
thing.


Their original purpose is extremely relevant to explain why they look
like they do, and why the developer has almost no way to modify them or
make them look better.

Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch

Jul 23 '05 #7
Ivo
"Laurent Bugnion" wrote
Ivo wrote:
"Laurent Bugnion" wrote If the OP feels the need to post two copies (almost) of a message, one
can reasonably expect that he will look for answers to both. Especially
in this case, where it's obvious that it's not an error.


The OP could have put his questions in one post. Much more convenient for
everyone. You could have pointed that out to him.
And anyway, why does it matter to you?


I read it! I care. Whatever. I don't like my Usenet cluttered up with this
repeating copies of messages, and undoubtedly many others feel the same way,
now and until the end of the last Usenet archive.
The confirm, alert and input message boxes were never designed for
user interaction, only for debug purposes.


Their original purpose is as relevant as the next thing. Those message
boxesare extremely useful and useable and I am sure many end users, from
geeks to total newbies, appreciate their lightweightness ,
straightforward ness andabsolute clarity to the point where even the
buttons *always* read the same thing.


Their original purpose is extremely relevant to explain why they look
like they do, and why the developer has almost no way to modify them or
make them look better.


Sure, it is relevant to explain those things. But when deciding on a way to
communicate with visitors to a webpage, the only things that count are
current things. Not original purposes. Just like the web's original purpose
was never anything pornographic or even commercial... From your words I get
the feeling that you find it wrong to use alerts and prompts in real-life
situations with real-life users, merely because of this original purpose. I
really don't follow, can't see any logic in that.
--
Ivo
http://4umi.com/web/javascript/





Jul 23 '05 #8
Hi,

Ivo wrote:
"Laurent Bugnion" wrote
Ivo wrote:
"Laurent Bugnion" wrote


If the OP feels the need to post two copies (almost) of a message, one
can reasonably expect that he will look for answers to both. Especially
in this case, where it's obvious that it's not an error.

The OP could have put his questions in one post. Much more convenient for
everyone. You could have pointed that out to him.


That's correct.
And anyway, why does it matter to you?

I read it! I care. Whatever. I don't like my Usenet cluttered up with this
repeating copies of messages, and undoubtedly many others feel the same way,
now and until the end of the last Usenet archive.


I was not aware it was your Usenet ;-) That said, you're right that
pointing it out to the OP would have been a good move.
Their original purpose is extremely relevant to explain why they look
like they do, and why the developer has almost no way to modify them or
make them look better.

Sure, it is relevant to explain those things. But when deciding on a way to
communicate with visitors to a webpage, the only things that count are
current things. Not original purposes. Just like the web's original purpose
was never anything pornographic or even commercial... From your words I get
the feeling that you find it wrong to use alerts and prompts in real-life
situations with real-life users, merely because of this original purpose. I
really don't follow, can't see any logic in that.


I do find it wrong when there are many better, more elegant ways, for
example, as you pointed out, floating DIVs and the such. That said, my
intent was not to force the OP to stop using alert confirm and input,
merely to explain why they look how they do. That could have been clearer.

Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch

Jul 23 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
25582
by: beliavsky | last post by:
Ideally, one can use someone's C++ code by just looking at the header files (which should contain comments describing the functions in addition to function definitions), without access to the full source code. Can analogs of C++ header files be created for Python code? Python "header" files could list only the 'def' statements and docstrings of Python functions and classes, but that does not tell you what the functions return. One could...
7
5075
by: Sherry Littletree | last post by:
Hi All I am working on a site that has a large amount of common html on all its web pages. I am looking for a way to place this in a single file so, if changes are made, I can change this single file and do not have to change each and every page. I have the Java scripting in a common .Js file but have not been able to find a way to do this with my html content.
9
13426
by: David D. | last post by:
Does the file extension matter when including a JavaScript file in an HTML page? Normally, one would include a JavaScript file in an HTML page using <script src="foo.JS" type="text/javascript"> However, I have found that I can use an alternate file extension, such as <script src="foo.HTML" type="text/javascript"> It works fine with my IE 6 and Mozilla. Will it work with other browsers?
2
2217
by: TadPole | last post by:
Hi all, My main problems are::::::::: 1. Set a value within a block container that can be used and changed by subsequent templates/block-containers/tables etc.. 2. get/determine/find the setting that tell the process that the new top of the document region is now at the end of the last block-container used, this must be set in that last block container. 3. find the value used in the 'top" setting on the prior
16
2915
by: a | last post by:
Hi everybody, My config: Win XP (or 2003), Apache 2.0.54, PHP 5.1.2. I have been trying to handle the case of a lenghty opearation on the server while providing the user with feedback and ability to cancel, and nothing seems to work so far. The following code is one attempt to address this, and it is called as result of a POST:
6
1575
by: dhillarun | last post by:
Hi everybody, I displaying file download window("save-as dialog box") using PHP "header()" function. How to track that user have clicked "save" button or "cancel" button???
1
1695
by: kang jia | last post by:
hi i don;t know what is the difference between"Header" and "Meta" data in PHP, as they all can redirect web page. anyone can help me, it is very urgent!! thaks
7
2242
by: TriAdmin | last post by:
I am working with a system that allow me to add custom fields but I can not add OnChange() language to the custom fields. So I want to have a function in the header that recognizes when fieldx is changed, do a calculation with the value of fieldx and change fieldy. Can that be done without having to add an OnCHange() event to fieldx? If so, can you give a quick example or link?
0
10148
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10002
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9938
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8822
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3528
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2794
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.