简体   繁体   中英

javascript pop-up error

I've an image column in an asp:repeater .

<asp:Image ID="telImage" runat="server" ImageUrl="../../images/telefon.png" />

I add onClick attribute in rptList_ItemDataBound

telImage.Attributes.Add("onClick", "javascript: Redirect('" + telImage.ToolTip + "')");

and javascript method

<script type="text/javascript">
    function Redirect(url) {
        if (confirm('Do you want to call?')) {
            window.open(url, "ekran", location = 1, status = 1, scrollbars = 1, width = 900, height = 700);               
        }
    }
</script>

When I click the image, a new window appears but it gives the following error: "HTTP Eror 404.0 - Not Found". How can I solve this?

I only want to run that url address. Is there any basic way? I'm correctly taking the url address.

The 3rd parameter of window.open must be string. Try

'location = 1, status = 1, scrollbars = 1, width = 900, height = 700'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM