joecool2005 Posted May 25, 2006 Share Posted May 25, 2006 How can I run this code on the server side?I know that should add runat="server", but I don't know where.<script LANGUAGE="JavaScript">var keyArray= new Array();var i=0;</script><% Set fs=Server.CreateObject("Scripting.FileSystemObject") Set f=fs.OpenTextFile(Server.MapPath("permission.txt"), 1) do while f.AtEndOfStream = false%><script> keyArray="<%= f.ReadLine%>"; i++;</script><% loop f.Close Set f=Nothing Set fs=Nothing%> Link to comment Share on other sites More sharing options...
reportingsjr Posted May 25, 2006 Share Posted May 25, 2006 um... javascript is a client side, why do you want it to be server-side anyways? Link to comment Share on other sites More sharing options...
pulpfiction Posted May 25, 2006 Share Posted May 25, 2006 The ASP code in the page will automatically run on the server side, you dont have to specifically mention anything for that... Link to comment Share on other sites More sharing options...
scott100 Posted May 25, 2006 Share Posted May 25, 2006 <html> <head> <title></title> </head> <body> <script language="JavaScript" runat="server"> response.write("<p>Hello World From Server Side JavaScript</p>") </script> </body></html> Link to comment Share on other sites More sharing options...
joecool2005 Posted May 25, 2006 Author Share Posted May 25, 2006 Yes, the ASP code is on server side. But when people do view source, they can see my javascript. That's why I want to run on the server side Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now