Home › Forums › JavaScript › [Solved] Window.[function name] not defined
- This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
-
AuthorPosts
-
August 12, 2014 at 3:13 am #178676matthiscoParticipant
Hi,
I have a jquery dialog in a closure which I am trying to fire in my code, Keep getting the error:
Error: TypeError: window.xxx.Alert is not a function
Can anyone please help?
$( ".terms" ).click(function() { Alert('test'); });
Here is my script
/*global window*/ /*global $ */ window.xxx= window.xxx|| {}; window.xxx.Alerter = (function () { 'use strict'; var alerter, confirm; alerter = function (passit, title, onclose, url) { $("#dialog-default > p").text(String(passit)); if (title !== undefined) { $("#dialog-default").attr('title', title); } else { $("#dialog-default").attr('title', 'Warning'); } $("#dialog-default").dialog({ open: function () { $(".ui-state-focus").blur(); $(this).load('/index.php'); }, modal:true, buttons: { "Close": function () { $(this).dialog("close"); if (onclose !== undefined) { onclose(); } } } }); }; confirm = function (message, title, onconfirm, oncancel) { var response = false; $("#dialog-default > p").text(String(message)); if (title !== undefined) { $("#dialog-default").attr('title', title); } else { $("#dialog-default").attr('title', 'Confirmation'); } $("#dialog-default").dialog({ open: function () { $(".ui-state-focus").blur(); }, buttons: { "OK": function () { $(this).dialog("close"); if (onconfirm !== undefined && onconfirm !== null) { onconfirm(); } response = true; }, "Cancel": function () { $(this).dialog("close"); if (oncancel !== undefined && oncancel !== null) { oncancel(); } response = false; } } }); return response; }; return { Alert: alerter, Confirm: confirm }; }());
August 12, 2014 at 3:25 am #178681Paulie_DMemberI’m a complete JS Novice…but shouldn’t it be
alert
rather thanAlert
…but then what do I know? -
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
- The forum ‘JavaScript’ is closed to new topics and replies.