-
Notifications
You must be signed in to change notification settings - Fork 662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncaught TypeError #9761
Comments
What version of WET and jquery? I am going to assume this has to do with the session timeout, as that is what the js code shows for Post your settings array with the refreshCallBack: value |
My version of WET seems to be 4.0.27 and JQuery seems to be v3.4.1
Here is my settings array:
$(document).on("wb-ready.wb", function (event) {
var settings = {
inactivity: 1620000, // 27 mins
reactionTime: 180000, // 3 mins
sessionalive: 1620000, // 27 mins
refreshCallbackUrl: "./keepAlive",
logouturl: "./login",
method: "GET",
refreshCallback: checkSessionValidity
}
$(".wb-sessto").trigger("reset.wb-sessto", settings);
});
Here is my checkSessionValidity function
function checkSessionValidity (responseBody) {
var str = responseBody.replace(/['"]+/g, "");
str = str.toUpperCase();
if (str == "SUCCESS") {
return "true";
}
else {
return "false";
}
}
…On Thu, May 9, 2024 at 12:45 PM Warren White ***@***.***> wrote:
What version of WET and jquery?
I am going to assume this has to do with the session timeout, as that is
what the js code shows for settings= $elem.data();
Post your settings array with the refreshCallBack: value
—
Reply to this email directly, view it on GitHub
<#9761 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AF6FSEAEFPMFZGVNCU25PF3ZBOR2BAVCNFSM6AAAAABHNQFJLWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBTGAZDQNBVGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I think I know the problem, the javascript error is because it is expecting a function where it receives a value. Change your refreshCallback setting to be an actual function, then in the function call your checkSessionValidity. Try this: var settings = {
inactivity: 1620000, // 27 mins
reactionTime: 180000, // 3 mins
sessionalive: 1620000, // 27 mins
refreshCallbackUrl: "./keepAlive",
logouturl: "./login",
method: "GET",
refreshCallback: function( response ) {
checkSessionValidity( response );
}
}; |
Hi mercury64, That's not it. Still getting same wet-boew.js error on line 9816:7 var elm = event.target Would you have any other idea why the wet-boew.js file is puking? |
Unfortunately I cannot reproduce your issue with wet 4.0.27 and jquery 3.4.1. One thing, I'm not sure why it happens is my ./keepAlive page is returning "success", but includes a \n. This is the javascript at the end of the page that I am testing with: <script>
(function($, window, wb) {
"use strict";
$(document).on("wb-ready.wb", function(event) {
var settings = {
inactivity: 30000, // 27 mins
reactionTime: 15000, // 3 mins
sessionalive: 30000, // 27 mins
refreshCallbackUrl: "./keepAlive",
logouturl: "./login",
method: "GET",
refreshCallback: function( response ) { /* callback function used to check the server response */
return checkSessionValidity( response );
}
}
$(".wb-sessto").trigger("reset.wb-sessto", settings);
});
function checkSessionValidity(responseBody) {
var str = responseBody.replace(/['"]+/g, "");
str = str.toUpperCase();
if (str == "SUCCESS\n") {
return "true";
} else {
return "false";
}
}
})(jQuery, window, wb);
</script> Sorry, cannot reproduce your error. |
event.target is undefined
What do you think? Is this getting called from something else? It seems to get triggered from various buttons on my page but never has anything other that undefined for event.target.
…On Tue, May 14, 2024 at 12:03 PM Warren White ***@***.***> wrote:
Hi mercury64,
That's not it. Still getting same wet-boew.js error on line 9816:7
var elm = event.target
Would you have any other idea why the wet-boew.js file is puking?
You will have to debug in console setting break point at line 9815, 9816
and see what event.target is. This should be the modal pop up button click,
maybe the default has been overridden by something else?
Screenshot.2024-05-14.at.09.01.13.png (view on web)
<https://github.com/wet-boew/wet-boew/assets/1203033/a2ea2b66-f398-4f6c-a54f-e30357b8d50b>
—
Reply to this email directly, view it on GitHub
<#9761 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AF6FSECRAG7AHRTXYKB4LMLZCIYVHAVCNFSM6AAAAABHNQFJLWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJQGYYDGOJXGU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
What do I look for it I wanted to find this being overridden by something else like you mention? |
Tough question. I would approach this using one or all of the following methods:
If you can, post a link to your page, or post the HTML here. If you cut&paste html, use code formatting three backticks ``` and the key word html, and close with backticks ``` ```html
<html>
<head><title>Your Page</title></head>
<body>
...
</body>
</html>
``` |
Okay thanks. I will have to look at this again before our next release. |
We are getting the below error in our implementation:
Uncaught TypeError: g.indexOf is not a function
at HTMLDocument. (wet-boew.js:9816:7)
at HTMLDocument.dispatch (jquery.min.js:2:42571)
at v.handle (jquery.min.js:2:40572)
(anonymous) @ wet-boew.js:9816
dispatch @jquery.min.js:2
v.handle @jquery.min.js:2
here is the code at lines 9815-9818
confirm = function( event ) {
$elm = $ ( elm ),
var elm = event.target,
settings = $elm.data();
Any idea what might be causing this?
The text was updated successfully, but these errors were encountered: