Calling Functions
Calling Functions
I'm writing a script that will only write certain code based upon the value output by an ASP script and I can't seem to get it to work.
Basically I have a common.js file with the following function in it:
-
function thisPop(){
alert("welcome");
}
Then, just to test the javascript part of the script, on the next line I have this:
-
<script type="text/javascript">
<%
response.write("$(document).ready(function(){ thisPop(); })")
%>
</script>
When I do this, I the alert does not work.
However if I remove the script from the common.js file and add it to the script like this:
-
<script type="text/javascript">
function thisPop(){
alert("welcome");
}
<%
response.write("$(document).ready(function(){ thisPop(); })")
%>
</script>
The script works just fine.
Anyone have any idea why the .js function wouldn't be referenced when you call the function in another script area?
I don't know too much about javascript, but am having to take on a project someone else started. So any suggestions would be appreciated.