Functions don't run in server side javascript 
Author Message
 Functions don't run in server side javascript

Hi, all
Functions don't  run  in server side javascript that
<script language="javascript" runat="server">
 function test()
  {
    alert ("Hello World");
  }
</script>
<input type="button" name="btn" id="btn" value="Please Click"
onclick="test()">

in run-time in onclick event of button  appear an error that it is expected
object...
runat="server"  properties doesn't support server side script.
remove runat="server" no problem  <script language="javascript"> =
No problembut <script language="javascript  runat="server"> = this is
problem and error. I want to run javascript server side.



Sun, 08 May 2005 00:53:42 GMT  
 Functions don't run in server side javascript
Alfaoglu wrote on 19 Nov 2002 in microsoft.public.scripting.jscript:

Quote:
> No problembut <script language="javascript  runat="server"> = this is
> problem and error. I want to run javascript server side.

Talking classical ASP:

You van run javascript serverside, but you cannot call a serverside
function from clientside.

The clientside does not know about any serverside functions and has no
commection with serverside to execute it.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)



Sun, 08 May 2005 02:02:13 GMT  
 Functions don't run in server side javascript
alert() is a method of the client-side window object. obviously it won't
run server-side.

________________________________________
I got bored with my old signature,
so I changed it

Atrax. MVP, IIS
http://rtfm.atrax.co.uk/

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sun, 08 May 2005 10:54:49 GMT  
 Functions don't run in server side javascript


Quote:
> alert() is a method of the client-side window object. obviously it won't
> run server-side.

I don't think the window object is the expected object. Rather it's the test
object that is expected.

Aside from that, it's true you can't use the alert method server-side. But
that's not the real problem here. It won't work with any method or
expression.

Xlnt



Sun, 08 May 2005 11:10:42 GMT  
 Functions don't run in server side javascript
true

________________________________________
I got bored with my old signature,
so I changed it

Atrax. MVP, IIS
http://rtfm.atrax.co.uk/

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Mon, 09 May 2005 09:09:18 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Function doesn't run in server side javascript

2. Calling client-side javascript function from server-side vbscript

3. Server Side Includes don't work

4. How do I call a VBScript-function from JavaScript in ASP (both server-side)

5. How can I run a javascript on server side

6. WshShell.Run don't run WHY ???

7. pass server side vbscript to client side javascript

8. Calling client-side javascript from server-side vbscript

9. Calling server-side function from client-side

10. functions to update DB don't wait for each other

11. network functions don't work in login scripts in 95

12. WScript don't run under Win95 ???

 

 
Powered by phpBB® Forum Software