The function defined by the second script will overwrite the function defined by the first one.
You can save a copy of the function from script A before including script B.
For example:
<script type="text/javascript" src="Script A"></script>
<script type="text/javascript">
var autoSave_A = autoSave;
</script>
<script type="text/javascript" src="Script B"></script>
<script type="text/javascript">
var autoSave_B = autoSave;
</script>
Note, by the way, that if script A calls autoSave
by name, the script will call the wrong autoSave
and (probably) stop working.
You could solve that by swapping in the autoSave
functions before calling functions from either script using wrapper methods.