Posts filed under ‘javascript’
open in full screen window
<script type=”text/javascript”>
<!–
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == ‘string’)
href=mylink;
else
href=mylink.href;
window.open(href, windowname, ‘,type=fullWindow,fullscreen,scrollbars=no’);
return false;
}
//–>
</script>
++++++++ html body ++++++++++++++++
<p><a href=”lookbook.aspx” onclick=”return popup(this, ‘notes’)”>View the Book </a>
++++++++ call the javascript in .cs file++++++++++++
行下面既code 係因為佢可以直接redirect 去到lookbook.aspx 個一頁, 但其實佢都係開左一頁先去到lookbook.aspx, 如果close 左lookbook.aspx 就會見到一早已去的頁面
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
ScriptManager.RegisterStartupScript(this, this.GetType(), “popup”, “popup(‘lookbook.aspx’, ‘notes’)”, true);
}