This question already has answers here:
How might I get the script filename from within that script?
(12 answers)
Closed 8 years ago.
Is there any way to get its filename by only using javascript?
For example
I want to get the string somefile.js?v=32&b=2.2 inside that same javascript file.
Is it possible to get it without going through the script tag?
Filename using only for loading script text. After that this script text puts in javascript tag and executes.
Related
This question already has answers here:
Typescript/Javascript load existing file without user interaction
(1 answer)
How to read a local text file in the browser?
(23 answers)
Loading an image to a <img> from <input file>
(7 answers)
Closed last year.
I have a JSON
MyJson = {name:"file1",path:"d://photos/photo.jpg"}
I want to get photo.jpg in a const variable
const file: File = MyJson.path;
How can I do this using Angular or Javascript?
This is not a duplicate of How to read text file please don't close.
I want to read this file as dataUrl.
This question already has answers here:
How to pass text in a textbox to JavaScript function?
(7 answers)
Closed 2 years ago.
I'm trying to create something that allows people to execute a line of JS. I want to convert the string that people type into a function to execute on the page using the HTML tag
I've looked around and nothing is helping to this.
you can use eval();
example :
eval("console.log('hello')");
This question already has answers here:
Why pass parameters to CSS and JavaScript link files like src="../cnt.js?ver=4.0"?
(9 answers)
Closed 7 years ago.
On some webpages I meet the following script tag:
<script type="text/javascript" src="../../Scripts/view-item-details.js?v1"></script>
what does ?v1 really stand for and why is it used?
Everything behind the question mark is a parameter that is delivered to the JavaScript.
In the given case a change in the version number prevents the browser from using the cached file and instead getting it from the server.
This question already has answers here:
How to get html source code from external url
(3 answers)
Closed 8 years ago.
How to get given URL's page source in Javascript.
Suppose i give
window.open("https://www.google.co.in");
then it should go to above URL and take page source of google.com which can be save in file.
I am using JS in HTML.
I you want a cross-domain solution (like your example for google), you can't.
See How to get html source code from external url
This question already has answers here:
Need to drag and drop a file in html [closed]
(2 answers)
Closed 10 years ago.
Im using Jquery ui. I want to drop a external file in a dropzone and get just the path of the file. I think i have to overwrite the default function window.drop. But im not sure how to do it or what to write instead ?
You can't get the local file path in JavaScript, for security reasons.