1

I am trying to create a SharePoint list item from a HTML file loaded into a SharePoint page.

The issue that I am facing is that the business will not allow any external CDN's meaning that any .js code has to be written and cannot link to jQuery files.

Does anyone have any points for how to create a SP list items with attachments without using jQuery / .ajax etc.?

I am have managed to get xmlhttpRequest to work to pull the information but cannot find a push / post solution.

4
  • Downloading jQuery files --> Uploading it to SharePoint document library (probably "Site Assets") --> And referencing the files from SharePoint. Is this approach allowed by your business? Jun 28 at 7:25
  • Which version of SharePoint you are using? You can also use JSOM for CRUD operations. Jun 28 at 7:28
  • downloads are not allowed either so I am not able to download the files. We are using SharePoint 2013 on premise. JSOM should would though. Do you have any useful resources you could advise of please for item creation with attachments?
    – jb12345
    Jun 28 at 7:39
  • Sure, check my answer below. Jun 28 at 7:55
1

As you are not able to use jQuery/.ajax, you can also use JSOM for CRUD operations.

Follow below link for creating list items & adding attachments:

To create a new list item:

  1. How to: Create, Update, and Delete List Items Using JavaScript
  2. What is best practice to add list item in SharePoint 2013 javascript object model?

To add list attachments:

  1. Upload File To List Item In Office 365 As An Attachment Using JavaScript Object Model

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.