I found some source codes out there for fetching date/time from a server, but unfortunately it is using php tags, ssi, etc. And I am on sharepoint w/c is a web hosting site, it pisses me off for the fact that it doesn't allow me to use < script > tags, php tags, and the likes. one of my problems can be found here.

我发现了一些源代码用于从服务器获取日期/时间,但遗憾的是它使用的是php标签,ssi等。而我在sharepoint w / c是一个网站托管网站,它让我很生气它不允许我使用

And if you have any ideas how. I would rather not use any libraries and just pure javascript only. It is because of the pesky sharepoint.

如果你有任何想法如何。我宁愿不使用任何库,只是纯粹的JavaScript。这是因为讨厌的共享点。

1 个解决方案

#1


I would recommend using the SharePoint Object Model (client or server) to fetch the date and time. The SharePoint Server should provide you with the data and time in accordance with it's regional settings. However, as Amadan mentioned, if you can't use <script> tags, you're kind of screwed. You could place a JavaScript file in your Asset Library, but you'll still have to load it and that'll be an issue. You may look into the Content Editor Web Part and inputting your javascript there. There's a chance it could work there.

我建议使用SharePoint对象模型(客户端或服务器)来获取日期和时间。 SharePoint Server应根据其区域设置为您提供数据和时间。然而,正如Amadan所提到的,如果你不能使用

I'm not sure what your use case is or what you want to do with said date/time, but you may want to consider this as it will be a driver in which methodology you'll want to use. If it's a SharePoint App, you've got all the tools you need. If it's just for your own purposes, you could look into the SharePoint Web Services and invoke that to get the Date and Time in an external program outside of SharePoint.

我不确定您的用例是什么或者您想要对所述日期/时间做什么,但您可能需要考虑这一点,因为它将成为您想要使用哪种方法的驱动程序。如果它是SharePoint应用程序,您就拥有了所需的所有工具。如果它仅用于您自己的目的,您可以查看SharePoint Web服务并调用它以在SharePoint外部的外部程序中获取日期和时间。

更多相关文章

  1. 输入类型=日期的日期显示为dd-mm-yyyy格式
  2. 在jQuery datetimepicker中禁用特定时间
  3. 根据用户时区显示当地时间 php+javascript
  4. JavaScript动态显示时间
  5. 我可以使用onBlur事件对TextBox进行日期检查吗?
  6. Day.js :一个轻量的处理时间和日期的 JavaScript 库
  7. 【第三篇】说说javascript处理时间戳
  8. 使用Isotop过滤日期
  9. 具有iOS Swift请求时间输出的Express.js服务器

随机推荐

  1. 什么是Azure Backup
  2. 牛逼 IDE 插件,一键部署 Docker 镜像,开发
  3. 芋道 Spring Cloud Alibaba 介绍
  4. 芋道 Spring Boot 快速入门
  5. 阿里云也有 IDEA 插件 Cloud Toolkit
  6. 芋道 Spring Cloud Alibaba 注册中心 Nac
  7. pytest测试入门篇(ExitCode退出码)
  8. 芋道 Spring Boot 自动配置原理
  9. 芋道 Spring Boot 热部署入门
  10. 芋道 Spring Boot MyBatis 入门