Skip to main content
gamedev.net
🔒 Locked

[web] javascript call from ASP

Started by Alessandro 1 reply 400+ views
Original Post
Alessandro
Alessandro
Hi, i have a very simple javascript function that i'd like to call directly from and asp page, how can i do that ? My code looks like this:

<head>
<script>
function Hello()
{
alert('Hello World');
}
</script>
</head> 


<body>
<%
' here i'd like to call the Hello() function
%>
</body>

markr
markr
You have misunderstood how ASP and javascript work. ASP is a server-side scripting system (albeit a deprecated one; use ASP.NET or something else instead for all new work). javascript runs client-side.<br><br>You can't call client-side code from server-side, or vice versa (although they can interact in some other ways).<br><br>By javascript, I mean client-side javascript (Not to be confused with using JScript on the server in ASP, which is possible but not recommended).<br><br>Consider what you actually want to achieve, and refactor it accordingly.<br><br>Mark

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.