Getting s.Type.ToUpperCase() is not a function when calling WCF service with $ajax
<p>I'm using WCF and I  am getting this error.
If I use jQuery1.14.1 I get</p>

<blockquote>
  <p>Type error: s.type.ToUpperCase is not a function<br>
  type = s.type.ToUpperCase();</p>
</blockquote>

<p>If I use jQuery 1.12.1 locally the service gets called corrctly. However, if I try it on the server, 1.14.1  get the error above, but 1.12 i get this one:</p>

<blockquote>
  <p>Type error: l.type.ToUpperCase() is not a function
      ..+&amp;&amp;n.event.trigger("ajaxStart"),l.type=l.type.ToUpperCase(), l,hasContent=!Kb.tes....</p>
</blockquote>

<p>Relevant code:</p>

<pre><code>var Type = "POST";
var DataType = "jsonp";
var ProcessData = true;
var ContentType = "application/json; charset=utf-8";

var params = {
    user: $("#userid_hidden").val().toString(),
    permission: $("#permission_id_" + i).val().toString(),
    enabled: true,
    note: $("#permission_note_" + i).val(),
    write: $("#permission_write_" + i).is(":checked")
}
SetPermission(params);

function SetPermission(params) {
    //alert('setting permission');
    if (params.enabled)
        CallService('wsEnablePermissionJSON', params);
    else
        CallService('wsDisablePermissionJSON', params);
}

function CallService(wsName, params) { //Generic function to call WCF  Service

    alert('calling service');
    $.ajax({
        type: Type, //GET or POST or PUT or DELETE verb
        url: Url + wsName, // Location of the service
        data: JSON.stringify(params),
        /*data: JSON.stringify(params),                          //Data sent to server*/
        contentType: ContentType, // content type sent to server
        dataType: DataType, //Expected data format from server
        processdata: ProcessData, //True or False
        success: function(msg) { //On Successful service call
            ServiceSucceeded(msg, wsName);
        },
        error: ServiceFailed // When Service call fails
    });
    alert('service called');
}
</code></pre>

<p>I can't see the rest of the error because the page is then reloaded, I got those by taking a screenshot.</p>

<p>I don't know how to go about this, I've tried jQuery 2 and I get the first error. I've used the same ajax call with another wcf service and it's currently working fine (the only difference is that the working one uses jQuery 1.12, and that solved it locally, in the server the new one fails.)</p>

<p>Both pages are in the same server.</p>

<p>I've been trying to figure this out for most of the day, but I haven't found anything, at first I thought that using 1.12 would solve it.
I googled the error but all the results were for different cases, I didn't see anything for the $ajax call.</p>