Home > front end >  Small white ask according to the date specified page how to implement the open?
Small white ask according to the date specified page how to implement the open?

Time:10-03

Is every day to open the home page to determine the date of the today, for 0103, for example, then open a directory 0103 HTML, of course the date is changing every day, if there is no HTML file with the same day, is out of the noday. HTML, could you tell me how to achieve?

CodePudding user response:

 
Var now=new Date ()
Var month=now. GetMonth () + 1
The month=month & gt;=10? The month: "0" + month
Var date=now. GetDate ()
The date=date & gt;=10? Date: "0" + date
Var url=`/a directory/${month} ${date}. The HTML `
The fetch (url). Then (res=& gt; {
If (res) status===404) {
Location. A href="https://bbs.csdn.net/topics/noday.html"
}
The else {
Location. A href=https://bbs.csdn.net/topics/url
}
})

CodePudding user response:

First of all, I appreciate your help, I understand, and I think whether can pop-up window can be closed in the div today, because I want to achieve in the history of the content is the PDF, my original idea is the pop-up window, the PDF content into HTML, in the pop-up page, but that feeling is bad, can have a better way to experience?

CodePudding user response:

In a popup window plug-in, url to PDF files

Reference: http://layer.layui.com/
  • Related