JavaScript error under Sp.ribbon.js on SharePoint Online

Hi everyone,
I'm trying to add a custom button on my ribbon for easier approval process, I use JavaScript to do this in a Script Editor web part on a task list view. The script works fine but when he tries to access the ribbon to actually add the button the ribbon crashes
so I don't even have the usual ribbon.
I used the IE JavaScript editor and I have an error on the sp.ribbon.js the "funny" part is that I only use that library I made no modification (also because I'm using SharePoint Online so I don't have access to it).
there is the error that I get with IE:
and there is the code I use to add the ribbon:
$this.ExecuteOrDelayUntilScriptLoaded(init_addButton, "sp.ribbon.js");
function init_addButton(){
setTimeout(function(){
var defaultWP = document.getElementById("MSOZoneCell_WebPartWPQ1");
WpClick({target:defaultWP,srcElement:defaultWP});
},100);
setInterval(function(){
if($("#RibbonContainer_activeTabId").val()==="Ribbon.ITEMS" || $("#RibbonContainer_activeTabId").val()==="Ribbon.ListItem"){
addRibbomButton();
},1000);
alert("test");
function addRibbomButton(){
if($("#ribbonApproveAll").length===0){
var b = [];
b.push("<li id='ribbonApproveAll' class=ms-cui-group unselectable='on'>");
b.push("<SPAN class='ms-cui-groupContainer' unselectable='on'>");
b.push("<SPAN class='ms-cui-groupBody' unselectable='on'>");
b.push("<SPAN class='ms-cui-layout' unselectable='on'>");
b.push("<SPAN class=ms-cui-section unselectable='on'>");
b.push("<SPAN class=ms-cui-row-onerow unselectable='on'>");
b.push("<A id='approveAllButton' class='ms-cui-ctl-large ms-cui-disabled' role=button onclick='approveSelected();return false;' href='javascript:;' unselectable='on' mscui:controltype='Button'>");
b.push("<SPAN class='ms-cui-ctl-largeIconContainer' unselectable='on'>");
b.push("<SPAN class=' ms-cui-img-32by32 ms-cui-img-cont-float' unselectable='on'>");
b.push("<IMG style='TOP: -129px; LEFT: -255px' alt='' src='/_layouts/1033/images/formatmap32x32.png' unselectable='on'>");
b.push("</SPAN>");
b.push("</SPAN>");
b.push("<SPAN class=ms-cui-ctl-largelabel unselectable='on'>"+tabBtn.btnLabel+"</SPAN>");
b.push("</A>");
b.push("</SPAN>");
b.push("</SPAN>");
b.push("</SPAN>");
b.push("</SPAN>");
b.push("<SPAN class='ms-cui-groupTitle' title='"+tabBtn.groupLabel+"' unselectable='on'>"+tabBtn.groupLabel+"</SPAN>");
b.push("</SPAN>");
b.push("<SPAN class='ms-cui-groupSeparator' unselectable='on'></SPAN>");
b.push("</li>");
setTimeout(function(){
if($("#Ribbon\\.ITEMS").length===1){
$("#Ribbon\\.ITEMS").append(b.join(''));
}else if($("#Ribbon\\.ListItem").length===1){
$("#Ribbon\\.ListItem").append(b.join(''));
},100);
alert("test");
alert("test 1");
setTimeout(function(){
var cc = new SP.ClientContext.get_current();
var web = cc.get_web();
var currLib = web.get_lists().getById(SP.ListOperation.Selection.getSelectedList());
var selectedItems = SP.ListOperation.Selection.getSelectedItems();
if(selectedItems.length>0){
$("#approveAllButton").removeClass("ms-cui-disabled");
}else{
$("#approveAllButton").addClass("ms-cui-disabled");
},200);
I didn't write that code but the website where I found it had some review that says that it was working and I'm more a C# dev than a JavaScript so I'm not use to debug it. Is that a version problem an implementation problem and how to solve it ? 
Thanks for your time :)

Hi,
I think this is not the right way of customising ribbon. SharePoint has a very powerful ribbon management XML framework. So instead of javascript hacking, I would recommend you to use the XML based ribbon customisation. Reference:
http://msdn.microsoft.com/en-us/library/office/jj163954(v=office.15).aspx.
Thanks,
Sohel Rana
http://ranaictiu-technicalblog.blogspot.com

Similar Messages

  • I am getting error when hovering on document in sharepoint online "sorry there was a problem and we can't open this document.If this happens again, try opening the document in Microsoft Word"

     I am getting error when hovering on document in sharepoint online "sorry there was a problem and we can't open this document.If this happens again, try opening the document in Microsoft Word".I am sure that document is not corrupted and
    all. something it showing the preview and sometimes it throwing this error. I hope this error is intermident. When clicking on the link also it throws this error but on refreshing it working fine. I dont know why it is happening. Please helpme  to resolve
    this issue. 

    Hi Waqas
    Thanks for your help with this. I had a look at both posts, the URL works fine from the WAC server and I am not using a System account to test docs.
    Also, this is a production site that is accessible over the Internet, so we are using https therefore the WOPIZone is external-https.
    Issue #3 in the above blog link does not reflect the same error I see on my servers.
    I also had a look at the information in this link: http://technet.microsoft.com/en-us/library/ff431687.aspx#oauth
    Problem: You receive a "Sorry, there was a problem and we can't open this document" error when you try to view an Office document in Office Web Apps.
    If you added domains to the Allow List by using the
    New-OfficeWebAppsHost cmdlet, make sure you’re accessing Office Web Apps from a host domain that’s in the Allow List. To view the host domains in the Allow List, on the Office Web Apps Server open the Windows PowerShell prompt as an administrator and run
    the Get-OfficeWebAppsHost cmdlet. To add a domain to the Allow List, use the
    New-OfficeWebAppsHost cmdlet.
    I have not added any domains to the Allow list so this did not help either. Should I add the domain?
    Any further help with this is much appreciated.
    Thanks again.
    Yoshi

  • Split Suite Bar and Ribbon Menu in SharePoint Online / O365

    As we all know the suite bar and ribbon menu controls are loaded from a single control. I have a requirement to place a div between suite bar and ribbon menu as shown in the image. Is it possible in SharePoint Online / O365? 
    Current suite bar and ribbon menu control(HTML Master Page Template)
            <div id="ms-designer-ribbon">
                <!--SPM:<%@Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->
                <div id="TurnOnAccessibility" style="display:none" class="s4-notdlg noindex">
                    <a id="linkTurnOnAcc" href="#" class="ms-accessible ms-acc-button" onclick="SetIsAccessibilityFeatureEnabled(true);UpdateAccessibilityUI();document.getElementById('linkTurnOffAcc').focus();return
    false;">
                        <!--MS:<SharePoint:EncodedLiteral runat="server" text="&#60;%$Resources:wss,master_turnonaccessibility%&#62;" EncodeMethod="HtmlEncode">-->
                        <!--ME:</SharePoint:EncodedLiteral>-->
                    </a>
                </div>
                <div id="TurnOffAccessibility" style="display:none" class="s4-notdlg noindex">
                    <a id="linkTurnOffAcc" href="#" class="ms-accessible ms-acc-button" onclick="SetIsAccessibilityFeatureEnabled(false);UpdateAccessibilityUI();document.getElementById('linkTurnOnAcc').focus();return
    false;">
                        <!--MS:<SharePoint:EncodedLiteral runat="server" text="&#60;%$Resources:wss,master_turnoffaccessibility%&#62;" EncodeMethod="HtmlEncode">-->
                        <!--ME:</SharePoint:EncodedLiteral>-->
                    </a>
                </div>
                <!--SID:02 {Ribbon Snippet}-->
                <!--PS: Start Preview--><div class="DefaultContentBlock" style="background:rgb(0, 114, 198); color:white; width:100%; padding:8px; height:64px; ">In true previews of your site, the SharePoint
    ribbon will be here.</div><!--PE: End Preview-->
            </div>
            <!--MS:<SharePoint:SPSecurityTrimmedControl runat="server" AuthenticationRestrictions="AnonymousUsersOnly">-->
                <!--SPM:<wssucw:Welcome runat="server" EnableViewState="false"/>-->
            <!--ME:</SharePoint:SPSecurityTrimmedControl>-->
    Actual Requirement 

    Hi,
    According to your description, my understanding is that you want to do customization in SharePoint Online with the requirement above.
    For the first question, continue to Scott, you can read the rss feed, the rss feed effectively contains the items from the list, you can read the list using Client Object Model to get RSS feed.
    For the second question, if you want to get current log in profile in my site, then you can try to use user profile rest api to get it.
    User profiles REST API reference
    For the third question, if you want to deploy the announcement app from on-premise to Online, if it's OOTB app, then it's not necessary, SharePoint Online have the announcement app as well.
    For the fourth question, if the CapIQ is a customize solution, I suggest you can use SharePoint hosted app to publish to the SharePoint online site.
    How to: Publish an app for SharePoint by using Visual Studio
    For the fifth question, if you want to upload the questions not create in site to the survey,  you can use Client Object Model to create the questions.
    Here is a similiar thread for your reference:
    Importing
    Questions into a Sharepoint Survey
    For the sixth question, if the information is stored in the list, then you can read the list using Client Object Model and it's better to create a SharePoint hosted app to achieve it.
    More information:
    How to: Create a basic SharePoint-hosted app
    Retrieve list item
    Thanks
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Error trying to create App for SharePoint Online

    I'm trying to create my first app for SharePoint Online using Visual Studio 2012. I believe I have all of the pre-reqs installed/configured. I have created a dev site in our SharePoint Online environment. I am a Site Collection administrator for that site.
    When I open VS2012, and try to create a new app project, it prompts me to connect to my dev site. When I enter the URL for that site, it give me the following login:
    We use ADFS, so when I enter my email address, it redirects me to my organizations federated login:
    Once I login, it takes me to the screen that reads "Error: An error has occurred on the server" with the standard SharePoint correlation id.
    I can't seem to get past this, and it won't let me start the new app project. Any thoughts on how to proceed?
    Thanks in advance,
    cflbasser

    Here is the correlation error screen for reference:
    When I click "go back to site", it takes me here:

  • "Unknown error trying to lock file." SharePoint Online

    Greetings,
    I am setting up a document library that will be used by users in our terminal session environment.  Hosts are Windows 2008 Server R2. We are setup in a Office 365 / SharePoint Online. We have Office 2013 installed on the hosts.The test user that I have
    setup has Edit permissions to this document library. Whenever the user goes to open a document in the library it always opens in "Read Only" mode, and when trying to edit I receive the message "Unknown error trying to lock file." I have
    read other threads and already changed the following.
    -Put our SharePoint in the correct internet zone / and trusted sites (GP)
    -Setting to require documents to be checked out before they can be edited (Library Settings)
    -Allow documents for opening in Read/Write (GP)
    -Added registry entry for AuthForwardServerList including our Sharepoint site (Registry)
    Any help would be greatly appreciated.
    Thanks,
    -Magoo

    Hi Dermot,
    Did this issue happen to all web applicaitons, and all users?  What if you access SharePoint site drectely other than via TFS?
    Have you checked if there is any related error message in SharePoint ULS log or event in Event Viewer for any clue?
    Also check if SharePoint server application pool (scheduled) recycle could help.
    http://www.techbubbles.com/iis/recycling-application-pools-in-iis-for-sharepoint-2010/
    Thanks
    Daniel Yang
    TechNet Community Support

  • Javascript error under IE 6 on System Messenger Express 6.1

    Hi ,
    I am using messaging server System Messenger Express 6.1 (2005Q1) for providing webmail service. It support en and zh-TW language.
    There are no problem on the webmail under english language version. However when user change his preferred language to zh-TW, after he login to the webmail and click the address book link, it has no problem on the first time access.
    However when user visit other link such as Inbox and then go back to the Address book page, it encounter the following error and no display on the screen.
    Line: 10
    Char: 35
    Error: Unterminated string constant
    Code: 0
    URL: http://hostname /zh-TW/pab_fs.html?&security=false&lang=zh-TW&charset=escaped_unicode
    Line: 16
    Char: 3
    Error: 'main' is not an object
    Code: 0
    URL: http://hostname/zh-TW/pab_fs.html?&security=false&lang=zh-TW&charset=escaped_unicode
    I have tried the same scenario in firefox and IE 5, it does not have the error above. I think user mostly will use the IE6 for browsing. Anyone has idea on it?
    Thanks

    One of many bugs in 6.1. Suggest upgrading to at least 6.2. Please note, 6.3 was released last week.
    6.1 to 6.2 is as easy as applying several patches:
    You will need to patch any JES componants that are on the same box, and the "shared componants". See the 6.2 documentation for how to upgrade.

  • Error with OpenSearch result source in Sharepoint online

    I have error with result sources that use the Opensearch protocol. I add them via Site Settings -> Edit Result Source -> New Result Source but everytime I test them in the Result Sources list I get error saying
    key is null or empty
    Parameter name: key
    This same happens every time regardless of the source Url. I've tried with sources like Live Search (Copied the url from the preset source "InternetSearchResults"), and other sources I've found from documentation and examples for Opensearch
    feature.
    Also, the error message is always the same when testing the Result Sources from the Result Source list, Query Builder or searching from Sharepoint site.

    I am having the same issue on o365 E3... any input on this? I have tried on 2 different envs.
    Danimal521 MCPD/MCAD

  • Javascript error which blocks online video from msnbc

    Frequently when I try to play an online video from MSNBC the video stops with a tapping sound and I see a javascript errors under the debug console alert.  There is no suggestion as to how to fix the error.  Do I need to go to the Apple store to fix this? 

    just download the MSNBC app.

  • Delete document button in ribbon gives javascript error: g is not a function

    Hello,
    We have a default SharePoint 2010 installation. So an out of the box site template, out of the box document libraries/lists etc, out of the box theme (default one) etc.
    When we check the checkbox next to a document in the shared documents library, the tab in the ribbon automatically switches to the document tab. In this tab there is a button "delete document". When I click that I get a confirmation request, I click OK,
    and then I get a little yellow box in the upper right corner that tells me SharePoint is deleting the document, and then nothing happens.
    The document stays where it is, no refresh of the page as SharePoint should do...
    I have a javascript error, and in FireFox it tells me "g is not a function" on line 2 of the file inplview.js?rev=AohvE9XEf%2FI78tuaw1TGAA
    Line 2 contains like 100 javascript functions on the same line, so it's impossible to find out which function or command throws the error.
    This is not a file created by me, so I guess it comes with SharePoint and that I should not touch it.
    So what do I do now?
    I have another server that we use for SharePoint testing, and there the button works as it should, so it's not SharePoint either...
    Problem is that we use this server to give basic SharePoint trainings to our employees, so it's not a very good start when we have to say the delete button is broken but will work in the actual production environment...

    Hi Stefan,
    In our case the problem was caused because initially we had set the authentication to basic authentication, and then changed the setting to claims based authentication. Somehow this causes SharePoint to give errors.
    I don't know if the same error occurs when you choose claims based authentication from the beginning (so without changing it after creating the web application).
    In our case we had the same behavior, in the ribbon the button didn't work, but in the context menu it did work.
    I don't have any other info, as I said in my previous post, I couldn't find any info on this issue on the net. We figured this one out ourselves. I don't know how to keep the claims based authentication, for us it was just a test to try out that type of
    authentication. Since we were running into problems and we didn't really need it we reverted it back to basic authentication.

  • Check in on status ribbon triggers SP.Ribbon.js javascript error?

    I have a SP 2013 installation with publishing sites and some of my sites are coming up with the following error. I have spent a few days trying to isolate the issue without success. Certain sites are experiencing this issues yet all sites are using
    the same Publishing site template and same masterpage.
    On the status bar for a page I see the following "Checked out to you Only you can see your recent changes.
    Check it in." and when I click on the check it is I get the following error. "SCRIPT 445: Object doesnt support this action. File: sp.ribbon.js, Line: 2, Column: 198501." If I edit the page and click check
    in then it works 100%. This error only displays when the page is saved and then I try check it in.
    If I add <script src="/_layouts/SP.UI.Dialog.js" type="text/javascript"></script> to the head of my masterpage the check in box appears however this messes up all the dialog boxes.
    Any ideas / suggestions would be appreciated.

    Hi ,
    For your issue, I suggest you use IE Developer 
    tools (F12)to debug the JavaScript error. About how to use IE Debug tool, you can refer to the links:
    http://msdn.microsoft.com/en-us/library/ie/gg699336(v=vs.85).aspx
    http://msdn.microsoft.com/en-us/library/dd565625(v=vs.85).aspx
    Here is a similar post with you, you can use as a reference:
    http://sharepoint.stackexchange.com/questions/117362/check-it-in-error-sp-ribbon-js?answertab=active#tab-top
    Best Regards
    Lisa Chen
    Forum Support
    Please remember to mark the replies as
    answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]

  • The underlying connection was closed: An unexpected error occurred on a receive..Exception.Message - while executing powershell command for sharepoint online site

    " +The underlying connection was closed: An unexpected error occurred on a receive..Exception.Message " OR sometimes
    "The remote server returned an error: (503) Server Unavailable..Exception.Message"
    Getting exception above when performing various operation (site coll creating, group creation, adding users to group) for sharepoint online (Office 365) site using powershell script.
    I want to create 3500 site collections using PS script. In-between getting above exception so it will skip one site collection creating and working again. for eg. after creating 11 site coll, script will through above exception and so 12th site coll will
    not be create but working fine from 13 and so on...

    Remote server seems working to me...any additional check?
    if problem with remote server then may be loop to create site provisioning should not start again..Right?
    any idea?

  • Sharepoint throw a javascript error while adding items to sharepoint list

    sharepoint throw javascript error when adding item to list
    error called:  this._registeredValidators[validatorIdx].Validate is not a function
    any help please

    Hi,
    If you want to validatelist column, there is out of the box way to accomplish this with SharePoint
    There's a great blog that covers how to validate Strict Text Formats:
    http://sharepointsolutions.com/sharepoint-help/blog/2011/12/how-to-validate-strict-text-formats-in-sharepoint-2010/
    In addition, we can use JavaScript to validate column. Please make sure you use the code correctly.
    More information:
    http://chrisstahl.wordpress.com/2011/02/06/validate-a-sharepoint-list-column-with-regular-expression/
    http://blog.tallan.com/2013/09/16/how-to-add-custom-validation-logic-to-validate-a-phone-field-in-sharepoint/
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Javascript error after last sharepoint 2013 update : unable share single list element

    After yesterday update of SharePoint 2013 using Windows update we receive a JavaScript error when we try to share a single list element. Our IE is Italian the error is "Properties or field not inizialized"
    This is the user interface "hanged" and wait ....
    The problem not exist if we share an entire list or website.
    LSo Lorenzo Soncini Trento TN - Italy

    Hi Lorenzo,
    Glad that you solved the issue and thanks for sharing, this will benefit others who have similar issue.
    Regards,
    Daniel Yang
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Javascript errors while adding attachment to list on ribbon sp 2013

    Hi All,
    Javascript errors while adding attachment to list sp 2013
    Webpage error details
    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E; InfoPath.3)
    Timestamp: Mon, 20 Oct 2014 09:49:13 UTC
    Message: Object required
    Line: 1
    Char: 122565
    Code: 0
    URI:
    https://server.com/_layouts/15/form.js?rev=PxBF2F2E04Ut1YUooXDAbg%3D%3D
    Screen become blank and nothing is dosplayed  when attach item is clicked for custom list
    Ravi

    Hi Ravi,
    According to your description, my understanding is that you encountered the error "Object required" when you try to add attachment to list in SharePoint 2013.
    For your issue, you can refer to the blog:
    http://kiran-kakanur.blogspot.com/2010/02/how-to-resolve-object-required-error-in.html
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • Javascript error on SharePoint page

    Hi Team,
    I'm updating a list column value by comparing a value of field from the same list using JS. It is working fine. But throwing javascript error on the page. 
    Below is the snippet.
    var web = null;
    var clientContext = null;
    var list = null;
    var item = null;
    var reviewStatus = null;
    $(document).ready(function () {
    setInterval(function () {
    $Text = $("td.ms-cellstyle.ms-vb2:contains('No')");
    $Text.parent().css("background-color", "#FFb3BD");
    $("input[name='teamCheckbox']").change(function () {
    var controlid = $(this).attr("id");
    var parts = controlid.split('_');
    var itemID = parts[1];
    clientContext = new SP.ClientContext(_spPageContextInfo.webAbsoluteUrl);
    var list = clientContext.get_web().get_lists().getById(_spPageContextInfo.pageListId);
    item = list.getItemById(itemID);
    clientContext.load(item);
    clientContext.load(item, 'Status');
    clientContext.executeQueryAsync(Function.createDelegate(this, LoadStatus), Function.createDelegate(this, onQueryFailed));
    }, 900);
    function LoadStatus() {
    reviewStatus = item.get_item('Status');
    if(reviewStatus)
    item.set_item('Status', 0);
    item.update();
    clientContext.load(item);
    clientContext.executeQueryAsync(Function.createDelegate(this, UpdateNo), Function.createDelegate(this, onQueryFailed1));
    }else
    item.set_item('Status', 1);
    item.update();
    clientContext.load(item);
    clientContext.executeQueryAsync(Function.createDelegate(this, UpdateYes), Function.createDelegate(this, onQueryFailed1));
    function onQueryFailed() {
    alert("Request Failed at 1st asych");
    function onQueryFailed1(){
    alert("Request Failed at 2nd asynch");
    function UpdateYes() {
    //reviewStatus = null;
    function UpdateNo()
    //reviewStatus = null;
    I'm getting the below JS error :
    Message: The property or field has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested. URI: _layouts/15/sp.debug.js?rev=vK8qdKxCg9qccxdMK5Ebzg%3D%3D
    $Q_2: function SP_ListItem$$Q_2($p0) {
    var $v_0 = (this.get_fieldValues())[$p0];
    if (SP.ScriptUtility.isUndefined($v_0)) {
    throw Error.create(SP.ResResources.getString(SP.ResourceStrings.propertyHasNotBeenInitialized));
    return $v_0;
    I have tried by calling the 2nd async query by changing to item.get_Context(); doesn't helped me.
    Please suggest how to kill this error...
    Thanks,
    Bharath P N
    P N Bharath

    Hi Dennis,
    I had tried by updating the script. But it is failing in update the list item. Please let me know if i'm doing wrong?
    $(document).ready(function () {
    setInterval(function () {
    $Text = $("td.ms-cellstyle.ms-vb2:contains('No')");
    $Text.parent().css("background-color", "#FFb3BD");
    $("input[name='teamCheckbox']").change(function () {
    var controlid = $(this).attr("id");
    var parts = controlid.split('_');
    var itemID = parts[1];
    var ctx = GetCurrentCtx();
    var listName = ctx.ListTitle;
    var url = _spPageContextInfo.webAbsoluteUrl;
    var currentStatus = null;
    var Status = null;
    getListItemWithId(itemID, listName, url, function (data) {
    if (data.d.results.length == 1) {
    currentStatus = data.d.results[0].Status;
    }, function (data) {
    alert("Error in GetListItemwithID method");
    if (currentStatus) {
    Status = 0;
    updateListItem(url, listName, itemID, Status, function () {
    alert("Item updated, refreshing avilable items");
    }, function () {
    alert("Ooops, an error occured. Please try again");
    } else {
    Status = 1;
    updateListItem(itemID, listName, url, Status, function () {
    alert("Item updated, refreshing avilable items");
    }, function () {
    alert("Ooops, an error occured else loop. Please try again");
    }, 900);
    function getListItemWithId(itemId, listName, siteurl, success, failure) {
    var url = siteurl + "/_api/web/lists/getbytitle('" + listName + "')/items?$filter=Id eq " + itemId;
    $.ajax({
    url: url,
    method: "GET",
    headers: { "Accept": "application/json; odata=verbose" },
    success: function (data) {
    success(data);
    error: function (data) {
    failure(data);
    function GetItemTypeForListName(name) {
    return "SP.Data." + name.charAt(0).toUpperCase() + name.split(" ").join("").slice(1) + "ListItem";
    function updateListItem(itemId, listName, siteUrl, title, success, failure) {
    var itemType = GetItemTypeForListName(listName);
    var item = {
    "__metadata": { "type": itemType },
    "Status": title
    getListItemWithId(itemId, listName, siteUrl, function (data) {
    $.ajax({
    url: data.d.results[0].__metadata.uri,
    type: "POST",
    contentType: "application/json;odata=verbose",
    data: JSON.stringify(item),
    headers: {
    "Accept": "application/json;odata=verbose",
    "X-RequestDigest": $("#__REQUESTDIGEST").val(),
    "X-HTTP-Method": "MERGE",
    "If-Match": data.d.results[0].__metadata.etag
    success: function (data) {
    success(data);
    error: function (data) {
    failure(data);
    }, function (data) {
    failure(data);
    P N Bharath

Maybe you are looking for

  • Deleted items showup in custom search

    We are using custom search portlet for search functionality on our site. The problem is, items that were deleted from a page in the past are also showing up in search results. And when we click on the item in search result, it throws page not found e

  • Value of New iBook G4 Value with extra programs???

    I wanted to know if anyone could tell me how much I could get for my iBook G4 its about 4 months old, the extra programs it has are: -Microsoft Office 2004 -Adobe Creative Suite 2-Illustrator CS2, In Design CS2, Go Live CS2, Photoshop CS2, Version Cu

  • Regarding vents in reports

    hi, In Reports is it mandatory that we have to provide start -of-selection with end-of-selection.

  • Output Preview should be more informative

    I love the Output Preview feature in Acrobat. I wish Illustrator had the same thing. However, I feel that there should be some improvement to it. For instance, for printers, it would be very handy to also include line screen, angle, and possibly dot

  • My DESKTOP looks like this, HELP

    Mac (20-inch, Early 2009) 2.66 GHz Intel Core 2 Duo Your Mac contains 2 memory slots, each of which accepts a 1067 MHz DDR3 memory module. 46 GB free out of 320 GB total I am trying to move most files to an external drive and somehow in the process m