<script type="text/javascript">
function EdgeCheck(){
var edge1;
var edge2;
var sBrowser;
edge1 = window.navigator.userAgent.indexOf("Edge") > -1;
edge2 = window.navigator.userAgent.indexOf("Edg") > -1;
if ((edge1) || (edge2)){
sBrowser = 'You are using Edge Browser';
//alert(sBrowser);
}
return sBrowser;
}
</script>
<% response.write("<b><font size='6' color='#008080'>" + '<script>EdgeCheck();</script>' + "</font></b>") %>
Asked
Active
Viewed 31 times
0

David
- 208,112
- 36
- 198
- 279

user1345246
- 135
- 1
- 9
-
1Are you sure that the function isn't being called at all, or is it just not printing the returned text? – kenput3r Jul 07 '20 at 14:36
-
Calling a JS function from ASP? You know ASP is a server-side language and JS is a client-side language, right? These two languages execute at different times and on different machines, they have no business with each other – Jeremy Thille Jul 07 '20 at 14:39
-
Does this answer your question? [What is the difference between client-side and server-side programming?](https://stackoverflow.com/questions/13840429/what-is-the-difference-between-client-side-and-server-side-programming) – Jeremy Thille Jul 07 '20 at 14:39
-
As kenput3r said above are you actually calling the JS at all or are you not just printing out . Have a look at https://stackoverflow.com/questions/16410968/calling-javascript-function-from-code-behind-asp-net to se the cotrrect way to call the JS.. – mkane Jul 07 '20 at 14:57
-
It is calling the function. When I uncomment the alert the alert pops up – user1345246 Jul 07 '20 at 15:25