执行脚本的位置

it's a stupid question but I'm not sure...if I have an external js file that runs an ajax jquery call the url that I specified inside the file must be considered relative to the position of the js(fun.js) or the position where the parent file(index.html) is? Thanks

Relative URL are always relative to the document, not the imported js files.

For most issues* you may consider your imported js files just as if they were included in your document at the point where you have the script element.

*There are differences regarding the loading time, "use strict" and the automatic statement closing at ends of file.

It's not matter where the js file located. It's matter which url you call through ajax.