You need to phrase your question better; I'm not exactly sure what you mean.
However, read
Managing Your JavaScript Library in ASP.NET and you should find out everything you need in order to successfully store JavaScript in a class library and register it on a page using, among other functions, RegisterStartupScript.