JavaScript Runat='server' will run at server ..?

liunx

Guest
hai every one

this is not a javascript question , but i am bit confussed on javascript...

My doubt is as follows:
=====================================================================
CODE ( inside code behind page )
======================================================================
string framescript="<script language='javascript' runat='Server' >
alert('hai')</script>";
Page.RegisterStartupScript("Framescript",frameScript);

======================================================================

will this prompt a alert at the client side if his or her brower do not support javascript or if it is disabled the confussing factor is that it is suppose to run at server ... what will happen ?

Thanks

keep smiling
austin
runat ='server'No, that will not promt users if they have JavaScript disabled. If you want to give those users a message, that's what the <noscript> tag is for:
<noscript><strong>WARNING:</strong> This page may not function
optimally without JavaScript enabled!</noscript>if you try to run that script it should throw an error in an asp.net page. One reason is javascript is not a .net language and the other is even if it were alert would not be valid due to the fact that this is running on the server.Oh and a third reason It would throw an error is you cannot dynamically write onto a page at runtime more code that has to run at the server. It is like trying to get the server side language to write out code for an include at runtime.
 
Back
Top