Cannot use 'javascript' because another language has been specified earlier in this page (or was implied from a CodeFile attribute).

Posted by klm9971 on Stack Overflow See other posts from Stack Overflow or by klm9971
Published on 2011-02-28T05:07:29Z Indexed on 2011/02/28 7:24 UTC
Read the original article Hit count: 444

Filed under:
|

Hello:

I have a website in which I am including a javascript file from this link: Code Snippet Page

I am getting this error: Microsoft JScript runtime error: Object expected

Here is my code:

     <%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ATP_Assignment.Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="topArea" runat="server">
    <div>
        <div id="matchUp" class="floatLeft">
            <div class="tabTop">
                <div class="tabTL"></div>
                <div class="tabTM">
                    <font class="title">Player Matchup History</font>
                </div>
                <div class="tabTR"></div>
            </div>
            <div class="tabMiddle">
                <asp:DropDownList ID="ddlPlayer1" runat="server" Height="16px" Width="146px" 
            DataTextField="Name" DataValueField="Id">

        </asp:DropDownList>
        &nbsp;&nbsp;VS&nbsp;&nbsp;
        <asp:DropDownList ID="ddlPlayer2" runat="server" Height="16px" Width="150px" 
            DataTextField="Name" DataValueField="ID">

        </asp:DropDownList>
                <asp:Button ID="Button1" runat="server" Text="Click" onclick="Button1_Click" />
        <br />
        Player1: <asp:Label ID="lblPlayer1Score" Value="" runat="server"></asp:Label>&nbsp;&nbsp;
        Player2: <asp:Label ID="lblPlayer2Score" Value="" runat="server"></asp:Label>
            </div>
            <div class="tabBottom">
                <div class="tabBL"></div>
                <div class="tabBM"></div>
                <div class="tabBR"></div>
            </div>
        </div>
        <div id="favList" class="floatLeft">
            <div class="tabTop2">
                <div class="tabTL"></div>
                <div class="tabTM2">
                    <font class="title">Favorite Player List</font>
                </div>
                <div class="tabTR"></div>
            </div>
            <div class="tabMiddle2">
                Enter Fav JQuery Here!!!
            </div>
            <div class="tabBottom2">
                <div class="tabBL"></div>
                <div class="tabBM2"></div>
                <div class="tabBR"></div>
            </div>
        </div>
        <div class="clearFix">&nbsp;</div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="contentArea" runat="server">
    <div class="padding">
        <div>
            <div id="playerList" class="floatLeft">
                <font class="title">Player List</font>
                <br />
                   <asp:DataList ID="PlayerList" runat="server">
            <ItemTemplate>
                Name:
                <asp:Label ID="lblFirstName" runat="server" 
                    Text='<%# Eval("FirstName") %>' />
                &nbsp;

                <asp:Label ID="lblLastName" runat="server" 
                    Text='<%# Eval("LastName") %>' />
                <br />
                Rank:
                <asp:Label ID="lblRank" runat="server" Text='<%# Eval("Rank") %>' />
                <br />
                Country:
                <asp:Label ID="lblCountry" runat="server" Text='<%# Eval("Country") %>' />
                <br />
<br />
            </ItemTemplate>
        </asp:DataList>
            </div>
            <div class="smallPadding">&nbsp;</div>
            <div id="video">
               </div>
            <div class="clearFix">&nbsp;</div>
        </div>
        <div id="tweet">
            <font class="title">Recent Tweets</font>
            <br />

        <script type="text/javascript">
            alert($ && $.fn ? $.fn.jquery : "jQuery not defined")
                  $(function () {
                        $("#favorites").tweet({
                            avatar_size: 32,
                            count: 3,
                            username: "atpworldtour",
                            favorites: true,
                            loading_text: "loading list..."
                        });
                    });

           </script>

        </div>
    </div>
</asp:Content>

Where should I put this code:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js"></script>

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jscript