JavaScript - Příklady I.

01.01.2012

Tvorba alertů

page.cs

Button1.Attributes.Add("onclick", "alert('My message')");

Potvrzovací dialog

page.cs

Button1.Attributes.Add("onclick", "getMessage()");

page.aspx

<script language=javascript>
function getMessage() {
    var ans = window.confirm('To continue.....?');
    if (ans==true) {
        document.Write('Yes');
    }
    else {
        document.Write('No');
    }
}
</script>

Otevření nového okna tlačítkem

page.cs

Button1.Attributes["onClick"] = "window.open('url', 'name', 'properties')";

© 2020 Olda Zátopek
Vytvořeno službou Webnode
Vytvořte si webové stránky zdarma! Tento web je vytvořený pomocí Webnode. Vytvořte si vlastní stránky zdarma ještě dnes! Vytvořit stránky