My javascript file(test.js) has Method1() method defined.
<script src="../Scripts/test.js" type="text/javascript"></script>
My html is defined as below. I get Method1() not found. Any ideas?
<p><input type="button" name="login" id="login" value="Login" onclick="Method1()"/> </p>
Here is the code in test.js declared…
<script type="text/javascript">
function LoginToServer() {
......
}
</script>
The code in
.jsfile is a JavaScript code, not HTML markup.This:
is HTML markup, not a JavaScript code. You should remove that from
test.js.As you didn’t show us exactly how your
Method1is defined, I’ll assume it is ok and this is the only error.