| Author |
Message |
mresetar
Joined: 05 Sep 2005 Posts: 4 Location: Croatia
|
Posted: Tue Sep 06, 2005 7:22 am Post subject: caption_onclick function |
|
|
Hi,
We are users of TreeMenu PRO version 2.7.0.
In menu I have node (last one) that doesn't have childs and on click must logout user.
Logout is achived through request to some URL. Before request I ask user to logout.
Script behaves differently in Firefox, Opera and Explorer.
Everything works OK in Firefox. On click user is asked to exit and if he clicks ok
request is send and everything is Ok. In Opera after confirmation menu blocks. On second
click user is logged out.
In IE after confirmation request is send, but I can see in monitoring tool that is
aborted, so user is logged out but doesn't receive response from server (new page).
Script doesn't have errors in none of browsers. Can you help me how I can get working script
in all of the browsers.
My logout script:
exit node:
[{id:10}, 'Exit', null, null, format:{caption_onclick:function (node) {exit('Exit?')}}}]
exit function:
function exit(message) {
if (confirmWithMessage(message)) {
window.location.href = "/xxx/yyy/logout.html";
}
else {
return false;
}
}
Thanks, Miroslav Resetar |
|
| Back to top |
|
 |
mresetar
Joined: 05 Sep 2005 Posts: 4 Location: Croatia
|
Posted: Fri Sep 09, 2005 8:33 am Post subject: |
|
|
Hi,
can someone from development team run some additional test on caption_onclick function? We realy need this functionality but it doesn't work as we expected.
Miroslav |
|
| Back to top |
|
 |
Victor_Chuiko Support Team
Joined: 12 Apr 2005 Posts: 145
|
Posted: Wed Sep 14, 2005 9:34 pm Post subject: |
|
|
Sorry about delay.
You dont need to use caption_onclick handler in this case. You just need to call a javascript function. We recommend you to do it like this:
| Code: | | ["Exit", "javascript:void(exit('Exit?'))", null] |
And your 'exit' function should look like this:
| Code: | function exit(message) {
if (confirm(message)) {
window.location.href = "/xxx/yyy/logout.html";
}
} |
Please, try itt and post your results. |
|
| Back to top |
|
 |
mresetar
Joined: 05 Sep 2005 Posts: 4 Location: Croatia
|
Posted: Mon Sep 19, 2005 2:38 pm Post subject: |
|
|
Thanks for answering.
Your solution works great in IE and Firefox.
Thanks again, Miroslav |
|
| Back to top |
|
 |
|