chil wrote:
Thanks a lot Evertjan. Now my question is how do I give different name
in the title. Can you suggest. I will explain clearly here. I want to
open www.yahoo.com
Now myURL is www.yahoo.com
I can set all parameters such as height, Location=no.
Now the the URL is coming on to the title. So How do I rename this. If
you can suggest I am thankful. Actually it is a business requirement.
<script type="text/javascript">
foo = false;
function openUrl(myURL,myTitle,width,height) {
if(!(foo) || foo.closed) foo = window.open();
foo.resizeTo(width,height);
foo.location.href = myURL;
var left = parseInt((screen.width-width)/2);
var top = parseInt((screen.height-height-60)/2);
foo.moveTo(left,top);
// changing title will be not allowed if from another domain
setTimeout('foo.document.title = \''+myTitle+'\';',3000);
foo.focus();
}
</script>
<p><a href="http://www.yahoo.com" target="_blank"
onclick="openUrl(this.href,'My Yahoo to me to me',500,420);
return false;">Yahoo</a>
<p><a href="http://www.google.com" target="_blank"
onclick="openUrl(this.href,'My Google to me to me',500,420);
return false;">Google</a>
<p><a href="#" target="_blank"
onclick="openUrl(this.href,'my test to me to me',500,420);
return false;">test</a>
If JavaScript is disabled Yahoo will be open in a new standard window
(if new windows are enabled)
<form style="display:none" id="search" name="search">
<select onchange="var i = this.selectedIndex;
if(i==0) alert('make a choice in list')
else
openUrl(this.options[i].value,this.options[i].text,500,420);">
<option selected="selected">Search in motors</option>
<option value="http://www.yahoo.com">Yahoo</option>
<option value="http://www.google.com">Google</option>
</select>
</form>
<script type="text/javascript">
document.forms['search'].style.display='block';
</script>
if JS disabled (and css enabled) -> no list
--
Stephane Moriaux et son [moins] vieux Mac