I know that we can call a JavaScript function on page load using jQuery:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js" type="text/javascript">
<script type="text/javascript">
$(document).ready(function() {
alert("Hello World!");
});
</script>
But how to do it if the function is inside an external ".js" file?
And another question please, can "src" tag have a value like this: src = "http://google.com"? I mean without the ".js"suffix at the end of it.
Thanks
Edit: What I mean by "external" is just another file on my desktop, not on the web.
scripttags belong to the same scope, hence you can just invoke the function normally ( provided, of course, that the file had already loaded ). As for your second question, I see no reason why you shouldn't be able to do such thing, provided that the server returns valid Javascript