N
Nettar
Hello,
I want to include a javascript from another javascript.
I know that I can do that by
document.write("<script src='another.js'>");
I am exposing my main.js (which contains the above code) directly,
intending it to be used via cross-site scripting (xss).
In this case, the above code doesn't work. Because an external html
which is using my main.js will look for another.js in its local
directory.
I have to change 'another.js' to '<absolute path>/another.js' for it
to work. But now if I change the location of main.js I have to make
changes in the above code too.
Is there a way to avoid specifying the absolute path of another.js ?
I want to compute its own location in main.js and then specify the
path of another.js relative to that.
Is that possible?
Regards
Jayarama Nettar
I want to include a javascript from another javascript.
I know that I can do that by
document.write("<script src='another.js'>");
I am exposing my main.js (which contains the above code) directly,
intending it to be used via cross-site scripting (xss).
In this case, the above code doesn't work. Because an external html
which is using my main.js will look for another.js in its local
directory.
I have to change 'another.js' to '<absolute path>/another.js' for it
to work. But now if I change the location of main.js I have to make
changes in the above code too.
Is there a way to avoid specifying the absolute path of another.js ?
I want to compute its own location in main.js and then specify the
path of another.js relative to that.
Is that possible?
Regards
Jayarama Nettar