Change Query to mQuery Sharepoint Online

Normally I have this code:

 Getting our list items    $.ajax({         url: url + "/_api/web/lists/getbytitle('" + listname + "')/items?$select=Title,Enlace&$orderby=Posicion&$top=6&$filter=Idioma eq '" + lang + "'",        method: "GET",         crossDomain: true,         headers: { "Accept": "application/json; odata=verbose",          "X-RequestDigest": $("__REQUESTDIGEST").val() },          contentType: "application/json;charset=utf-8",         success: function (data) {            completeMenu(data, target);         },         error: function (data) {             failureMenu(data, target);        }     }); }     

So it works well, but I want to change it to mQuery, so I do:

     SP.SOD.executeFunc('mQuery.js', 'm$', function() {     m$.ready(function() {      SP.SOD.registerSod('sp.requestexecutor.js',         '/_layouts/15/sp.requestexecutor.js');     SP.SOD.executeFunc('sp.requestexecutor.js',          'SP.RequestExecutor',      function() {         var targetSiteUrl = url;     var targetUrl = url + "/_api/web/lists/getbytitle('" + listname + "')/items?$select=Title,Enlace&$orderby=Posicion&$top=6&$filter=Idioma eq '" + lang + "'"; var re = new SP.RequestExecutor(targetSiteUrl); re.executeAsync({     url: targetUrl,     headers: { "Accept": "application/json; odata=verbose" },     method: 'GET',     success:function(response) {     console.log(response);        completeMenu(respone, target);              }         });     }); })}); } 

But isnĀ“t works, I use breakpoints in source chrome console, it read this line:

 SP.SOD.executeFunc('mQuery.js', 'm$', function() { 

but the next one is not readed, what is wrong with my code? Regards


Category: sharepoint online Time: 2016-07-28 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 0.212 (s). 12 q(s)