Hello,
I have been using Javascript CSOM via SharePoint Pages that are hosted on SharePoint Server. This works well.
I was wondering it it is possible to create a simple HTML Page outside SharePoint with necessary CSOM code and access the SharePoint site?
I want to run this page directly from my Windows Explorer or host this HTML into some other technology like – Apache / PHP. (I can download the required JS files from SP_ROOT folder and distribute it on Apache/PHP)
Thanks,
Kamlesh
A bare minimum is required:
<!DOCTYPE html>
<%@ Page language="C#" %>
<%@ Register Tagprefix="SharePoint"
    Â
Namespace="Microsoft.SharePoint.WebControls"
    Â
Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<
html
>
<
head
>
   Â
<!-- the following 5 js files are required to use CSOM -->
   Â
<
script
src
=
"/_layouts/1033/init.js"
></
script
>
   Â
<
script
src
=
"/_layouts/MicrosoftAjax.js"
></
script
>
   Â
<
script
src
=
"/_layouts/sp.core.js"
></
script
>
   Â
<
script
src
=
"/_layouts/sp.runtime.js"
></
script
>
   Â
<
script
src
=
"/_layouts/sp.js"
></
script
>
   Â
<!-- include your app code -->
   Â
<
script
src
=
"app.js"
></
script
>
</
head
>
<
body
>
   Â
<
SharePoint:FormDigest
ID
=
"FormDigest1"
runat
=
"server"
></
SharePoint:FormDigest
>
</
body
>
</
html
>