Note that there are some explanatory texts on larger screens.

plurals
  1. POError: The value of the property 'warn_redirect' is null or undefined, not a Function object
    primarykey
    data
    text
    <p>I have a page in one of my ASP.NET applications (VB) that relies on a 3rd party service being live, and I'm using jQuery to display an overlay if this service is found to be down. I've been using the same approach for other warnings in the app - the difference with this one is that it needs to redirect after the user clicks the button on the warning popup to remove the overlay. For some reason I'm getting the error "Error: The value of the property 'warn_redirect' is null or undefined, not a Function object."</p> <p>Any assistance is greatly appreciated! My code follows:</p> <p>jQuery</p> <pre><code>function warn_redirect(msg, title, nextpage) { // show modal div //alert(obj.id); $("html").css("overflow", "hidden"); $("body").append("&lt;div id='popup_overlay'&gt;&lt;/div&gt;&lt;div id='popup_window'&gt;&lt;/div&gt;"); $("#popup_overlay").addClass("popup_overlayBG"); $("#popup_overlay").fadeIn("slow"); // build warning box $("#popup_window").append("&lt;h1&gt;" + title + "&lt;/h1&gt;"); $("#popup_window").append("&lt;p id='popup_message'&gt;&lt;center&gt;" + msg + "&lt;/center&gt;&lt;/p&gt;"); $("#popup_window").append("&lt;div class='buttons'&gt;&lt;center&gt;&lt;button id='continue' class='positive' type='submit'&gt;OK&lt;/button&gt;&lt;/center&gt;&lt;/div&gt;"); // attach action to button $("#continue").click(popup_remove_redirect(nextpage)); // display warning window popup_position(400, 300); $("#popup_window").css({ display: "block" }); //for safari using css instead of show $("#continue").focus(); $("#continue").blur(); } function popup_remove_redirect(nextpage) { $("#popup_window").fadeOut("fast", function () { $('#popup_window,#popup_overlay').trigger("unload").unbind().remove(); }); $("body", "html").css({ height: "auto", width: "auto" }); $("html").css("overflow", ""); window.location.href = nextpage; </code></pre> <p>}</p> <p>Here is the VB.NET calling code:</p> <pre><code>If Status = "DOWN" Then Dim clsUtility As New Utility clsUtility.Emailer("email@company.com", "email@company.com", "", "", "The Service Is Down!", "Please investigate") Dim ScriptString As String = "&lt;script language='javascript'&gt;" ScriptString += "warn_redirect('Some warning message.', 'Warning', 'AnotherPage.aspx');" ScriptString += "&lt;/script&gt;" ClientScript.RegisterStartupScript(Me.GetType, "warnscript", ScriptString) 'Response.Redirect("AnotherPage.aspx?ID=" &amp; Session("SelKey") &amp; "&amp;UN=" &amp; Header1.UserNumber) //this didn't work either End If </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload