can i write two javascript in one form?

Discussion in 'JavaScript' started by raspms, Mar 30, 2012.

  1. #1
    hello,
    i have asp.net project in that i take two script .In one i have added one jquery file and i want to take another script fuction only for display the message..
    this is the code

    <script src="../jquery-1.2.6.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(document).ready(function () {
    $("#<%=GridView1.ClientID%> input[id$='chkAll']:checkbox").click(function () {
    $("#<%=GridView1.ClientID%> input[id*='chkSelected']:checkbox").attr('checked', $(this).is(':checked'));
    });
    });
    </script>
    <script>
    fuction message()
    {
    alert({"Select one checkbox");
    }
    </script>

    but when i run this one it will show me error...plz give me advise.
     
    raspms, Mar 30, 2012 IP
  2. e-abi

    e-abi Member

    Messages:
    122
    Likes Received:
    1
    Best Answers:
    3
    Trophy Points:
    38
    #2
    For starters you could copy the script that is already rendered inside the html source.
    And of course you could paste the exact error.

    Alternatively you could install firebug extension for FireFox and inspect the error yourself.
     
    e-abi, Apr 9, 2012 IP
  3. Basti

    Basti Active Member

    Messages:
    625
    Likes Received:
    6
    Best Answers:
    3
    Trophy Points:
    90
    #3
    There is at least one error in the code.
    alert({"Select one checkbox");
    
    Code (markup):
    there is a { before the quotes which does throw a error
     
    Basti, Apr 11, 2012 IP