I have a SharePoint Document view that allow people to upload file. However, I have a Javascript variable that will control when can the people upload file.
If the javascript variable is being assigned a value, say "Close", the SharePoint Document view should either not display on the screen or the whole aspx file cannot be access.
However, if the javascript variable is being assigned a value, say "Open", the SharePoint Document view will be display and people can upload their files or click New document.