Reputation: 977
I am using window.showModalDialog
in current apps. How can change title based on upon some conditions in javascript? Can anybody help on this. Please don't consider duplicate post. I tried different ways to change title:
window.document.title="Add Cartons"
var results=window.showModelDialog(url,"Add Cartons",windowarguments)
But I can't successes.
Please help on this.
Upvotes: 0
Views: 6893
Reputation: 12440
Microsoft has a detailed solution over this problem. Please refer to
support.microsoft.com/kb/263033
Upvotes: 0
Reputation: 3569
Try this:
window.document.title = "yourtitle";
if (window.dialogArguments) {
window.opener = window.dialogArguments;
}
function setTitle() {
document.title = "NewTitle";
alert(document.title)
}
Upvotes: 1
Reputation: 23416
You can pass a new title via dialog arguments
argument, just like you've tried:
var results = window.showModalDialog(url, 'Add Cartons', windowarguments);
And then in a script in the dialog:
document.title = window.dialogArguments;
Though looks like they haven't fixed the showModalDialog()
in Chrome yet. So this is not going to work in Chrome.
Upvotes: 1
Reputation: 37711
You need to change the title of the window you're calling (the popup), not the one from which you're calling the popup. So, put <title>Add Cartons</title>
inside the head of your popup and it will show up.
To modify it based on the popup call, use the arguments, read them from the popup and dynamically change the title.
Upvotes: -1