jquery.min.js ajax,javascript - Uncaught TypeError: Illegal invocation jquery.min.js:4 [Ajax, jQuery...

I getting this error when my $.ajax line runs.

Uncaught TypeError: Illegal invocation jquery.min.js:4

e jquery.min.js:4

Vc jquery.min.js:4

Vc jquery.min.js:4

Vc jquery.min.js:4

m.param jquery.min.js:4

m.extend.ajax jquery.min.js:4

ajaxFunction NewHost.php:231

validateInput NewHost.php:324

onclick NewHost.php:114

As far as I know the rest of the script works.

I'm changing from using vanilla ajax to jQuery and ajax. The ajax call was adapted from a separate page that did work.

The URL, data, and success attributes were changed to match the page needs.

The line that fires the error is $.ajax({ I know that means that the whole function has a problem.

Here is the non working function

function ajaxFunction(){

var Fname = document.getElementById("FName").value;

var Lname = document.getElementById("LName").value;

var BirthDate = document.getElementById("BirthDate").value;

var email = document.getElementById("email").value;

var Pass = document.getElementById("Pass").value;

$.ajax({

url: "ProHost.php",

data: { FName:Fname, LName:LName, BirthDate:BirthDate, Email:email, Pass:Pass },

type: "GET",

//cache: false,

async:false,

success : function (result) {

console.log("Request sent");

var result=trim(result);

$("#demo").hide();

if(result == 'correct'){

console.log(result);

location.assign("/e-Party/HostAcountPage.php");

}else{

console.log(result);

$("#demo").html("You are now registered $FName $LName , please sign-in ");

}

}

});

}

here is the working call:

var Email = document.getElementById("Email").value;

var Pass = document.getElementById("Pass").value;

console.log( Email + '| | ' + Pass);

$.ajax({

url: "Process.php",

data: { Email:Email, Pass:Pass },

type: "POST",

//cache: false,

async:false,

success : function (result) {

console.log("Request sent");

var result=trim(result);

$("#flash").hide();

if(result == 'correct'){

//console.log(result);

location.assign("/e-Party/HostAcountPage.php");

}else{

console.log(result);

$("#errorMessage").html(result + " New Host?");

}

}

});

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值