My imagebutton will not cause the popup window to appear when its clicked. Here is my code.
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<script type="text/javascript">
function goToAddNewsletterAddPage()
{
window.open("Newsletter.aspx","mywindow");
}
</script>
<asp:Image ID="Image1" runat="server" Height="87px" Width="158px" ImageUrl="~/images/signup.gif" onclick="goToAddNewsletterAddPage()"/>
If you look in the console of the browser, you should see a syntax error. Function declarations (the style you’ve used in your script) must have a function name, so there’s a syntax error…
Perhaps you meant:
(There is a different, but related, thing called a function expression, which doesn’t have to have a function name [and due to IE bugs is usually better off without one], e.g.:
The key to knowing which is which is to look to see whether the
functionstructure is being used as a right-hand value, e.g., the right-hand side of an assignment [=] or initializer [:], or being passed into a function as an argument. If it is, it’s a function expression; if not, it’s a function declaration.)