Link to home
Start Free TrialLog in
Avatar of curiouswebster
curiouswebsterFlag for United States of America

asked on

trouble with an external javascript file format

I added this file:

function myFunc() {
    alert('You moused over the button');
}

and was prompted to add it to the App_Code folder, which I did. but it has a compile time error with alert.  What am I missing?

Thanks,
newbieweb
Avatar of curiouswebster
curiouswebster
Flag of United States of America image

ASKER

This file pops up when I say I DO NOT want to run in spite of compiler errors. Not sure what I am looking at:


//------------------------------------------------------------------------------
/// <autogenerated>
///     This code was generated by a tool.
///     Runtime Version: 4.0.30319.1
///
///     Changes to this file may cause incorrect behavior and will be lost if
///     the code is regenerated.
/// </autogenerated>
//------------------------------------------------------------------------------

[assembly: System.CodeDom.Compiler.GeneratedCodeAttribute("ASP.NET", "4.0.30319.206")]
[assembly: System.Security.SecurityRulesAttribute(System.Security.SecurityRuleSet.Level2)]
[assembly: System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.0")]
SOLUTION
Avatar of Proculopsis
Proculopsis

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The question is what should my entire external JavaScript look like?

This:

function myFunc() {
    alert('You moused over the button');
}

is clearly not enough. Are there headers needed? Or do I need to add other files (like JQuery)? to my project?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks.