Click to See Complete Forum and Search --> : window.oprn problem


raghu
04-18-2003, 11:26 AM
Hi,

I have to open a new window on a href by calling a
javascript method and set the new window title based on it.

the title needs to be "download book" instead of download book, also the name of the window needs to be the same.

the below code works only if i pass "downloadbook" instead of
"download book" to the jsview "name" parameter.

In all, i need to set the name of the window as "download book" and set the new window's title also the same.


Here is the sample code.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<script>
// This is Function is Used to Display the New window with proper settings.
function jsView(sUrl, sName, sTitle, bBrowserBars, iHeight, iWidth)
{
if (bBrowserBars == false)
{
var sOptions = "scrollbars=yes,resizable=yes,menubar=yes,toolbar=yes,location=no,left=10,width=" + iWidth + ",height=" + iHeight + ",title=" + sTitle;
}
else
{
var sOptions = "scrollbars=yes,resizable=yes,menubar=yes,toolbar=yes,location=no,left=10,width=" + iWidth + ",height=" + iHeight + ",title=" + sTitle;
}
window.open(sUrl,sName,sOptions);
}
</script>
</head>
<body>
<a href="javascript:jsView('zip.asp?id=1234','Download Book','Download Book',true,'300','400')" title="download book" class="udrlinesmall">Download book</a>
</body>
</html>

DrDaMour
04-18-2003, 12:37 PM
use html escape sequences, i can't remember them exactly, go to google and search for "html escape sequences" and tons of lists will pop up, just put the sequence taht matches to quotes to where you want it. As far as the targetname, why does it need to be in quotes? that woudl be confusing to use.

If you really need that, what you should do is make a function and have your click event call that function.

fucntion crap(){

javascript:jsView('zip.asp?id=1234','"Download Book"','"Download Book"',true,'300','400')"

}

taht will make it so the quotes don't get all confused.