1

I have a SharePoint 2007 list that have version history enabled.

I am interested to know how do I view the version history of a item using Javascript (or JQuery).

2
  • 1
    FYI - I've added GetVersionCollection into the latest alpha on SPServices, but I don't think it's going to be as useful as you'd like. See spservices.codeplex.com/releases/view/77486 Commented Dec 30, 2011 at 20:36
  • Thanks Marc. Actually, I found the GetVersionCollection that you added into the latest alpha1 on SPServices very useful as it allow me to track the version history of each item in the list. Well Done. :) Commented Jan 3, 2012 at 1:07

2 Answers 2

2

To make things even simpler on yourself, I would recommend using SPServices.

It has full support for the Versions web service in both SharePoint 2007 and 2010, which enables you to call the GetVersions method exposed by that service.

For example:

$().SPServices({
    operation: "GetVersions",
    fileName: "http://spsrv2010/DocLib/file.txt",
    completefunc: function (xData, Status) {
        // Do other stuff...
    }
});
4
  • Hi Danny, does it also get versions from items in a SharePoint 2007 List? (Cause I notice that it need to know a filename - which probably a file from a SharePoint 2007 Library, but does a item in a Sharepoint 2007 List have a filename?) Commented Nov 24, 2011 at 0:49
  • Larry - for a standard list, you will actually want to use the GetVersionCollection method of the Lists web service. Unfortunately, it doesn't look like SPServices has support for that particular method at this point. With that in mind, you may want to use dhanya's approach. The MSDN documentation for the GetVersionCollection method can be found here: msdn.microsoft.com/en-us/library/… Commented Nov 24, 2011 at 14:22
  • If you want a Web Service operation that isn't included in SPServices, please leave a message in the Discussions, and I'll get it in there for you. Commented Nov 28, 2011 at 1:04
  • @MarcDAnderson Thanks Marc, I posted a new discussion over there. (spservices.codeplex.com/discussions/284298) Commented Dec 28, 2011 at 2:13
0

You can make ajax calls to version webservice http:///_vti_bin/versions.asmx

See the below link make ajax cal to webservice

http://sharepoint-snippets.com/ajax-calls-sharepoint-web-services-using-jquery/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.