How to use javascript to get UUID and javascript to get UUID
Because javascript is a single-threaded thing, we put an accumulation variable as the id will not be repeated.
But in fact, javascript itself provides something that can get a unique id. Remember that the setTimeout () method returns a unique id to clear the timer, so we can borrow this id.
function getUUID() { var id = setTimeout('0'); clearTimeout(id); return id;};
How can I use JavaScript to obtain the URL of the current page?
<Table width = 100% cellpadding = 0 cellspacing = 0 border = 0>
<Script language = "javascript">
ThisURL = document. URL;
ThisHREF = document. location. href;
ThisSLoc = self. location. href;
ThisDLoc = document. location;
Strwrite = "<tr> <td valign = top> thisURL: </td> <td> [" + thisURL + "] </td> </tr>"
Strwrite + = "<tr> <td valign = top> thisHREF: </td> <td> [" + thisHREF + "] </td> </tr>"
Strwrite + = "<tr> <td valign = top> thisSLoc: </td> <td> [" + thisSLoc + "] </td> </tr>"
Strwrite + = "<tr> <td valign = top> thisDLoc: </td> <td> [" + thisDLoc + "] </td> </tr>"
Document. write (strwrite );
</Script>
ThisDLoc = document. location; <BR>
ThisURL = document. URL; <BR>
ThisHREF = document. location. href; <BR>
ThisSLoc = self. location. href; <BR>
<Script language = "javascript">
ThisTLoc = top. location. href;
ThisPLoc = parent.doc ument. location;
ThisTHost = top. location. hostname;
ThisHost = location. hostname;
Strwrite = "<tr> <td valign = top> thisTLoc: </td> <td> [" + thisTLoc + "] </td> </tr>"
Strwrite + = "<tr> <td valign = top> thisPLoc: </td> <td> [" + thisPLoc + "] <& #4 ...... remaining full text>
Everybody, how can I use javascript to retrieve all the content on the current page and save it to the specified directory?
You can use document.doc umentelement. outerhtml to obtain html.
You can use the fso = new actinvexobject ('wscript. filesystemobject ') object to save the file. This is a security issue and it is difficult to set the browser.
The specific requirements depend on the requirements and runtime environment.
In fact, the script has powerful functions, but it also has great limitations. It depends on the situation in which it is used.
I haven't used this for a long time. I can only provide you with one idea. You have to write the code yourself.