---
title: "Disabling Pop Up in javascript"  
description: "Disabling Pop Up in javascript"  
author: "Anonymous User"  
published: 2014-11-20  
updated: 2014-11-21  
canonical: https://www.mindstick.com/forum/12656/disabling-pop-up-in-javascript  
category: "javascript"  
tags: ["c#", "asp.net"]  
reading_time: 2 minutes  

---

# Disabling Pop Up in javascript

I am new to Javascript. My req is to not show the [pop up](https://answers.mindstick.com/qa/50233/what-to-do-with-the-issues-that-may-pop-up-at-the-time-of-usb-device-installation) if i get list from [server side](https://www.mindstick.com/forum/318/how-to-call-javascript-fuction-in-server-side) as empty list. Before this [requirement](https://yourviews.mindstick.com/view/85169/becoming-an-influencer-requirement-of-skills-and-knowledge) i was [doing something](https://www.mindstick.com/forum/33390/nsdateformatter-am-i-doing-something-wrong-or-is-this-a-bug) like below [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii) where as soon as [user](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server) hits the [URL](https://www.mindstick.com/forum/436/url-redirection), the [popup](https://www.mindstick.com/blog/11734/how-to-create-advanced-popup-or-banners-with-news-images-discounts-in-magento2) comes as i have used window.onload . Now the requirement got changed and i need to show pop up only when there is some [data](https://www.mindstick.com/articles/13050/salesforce-aiming-to-dominate-predictive-analytics-with-data-science) from backend. Please help me on this.

```
<script>    window.onload = function () {        $('#homePopup').bPopup({            easing: 'easeOutBack', //uses jQuery easing plugin            speed: 550,            transition: 'slideDown'        })    }</script> <div id="homePopup"><span class="buttonCloseModal b-close"><span>X</span></span>  <h1>Notifications</h1> <div class="ListContainerScroll">        <div>               <asp:Repeater ID="rptrNotification" runat="server" OnItemDataBound="rptrNotification_ItemDataBound">                        <ItemTemplate>                              <div>                                    <asp:Literal ID="litNotificationTitle" runat="server" Text='<%# Bind("Title") %>'></asp:Literal>                              </div>                               <div>                                     <asp:Literal ID="litNotificationDesc" runat="server" Text='<%# ((SPListItem)Container.DataItem)["NotificationDescription"] %>'></asp:Literal>                               </div>                         </ItemTemplate>               </asp:Repeater>                    <div class="noDataAvailable" runat="server" id="divNoDataAvailable" visible="false"></div>        </div>   </div></div>
```

## Replies

### Reply by Norman Reedus

A piece of code you have put inside function of the onload event of the window you are going to put inside ajax success callback (i guess you are requesting data with jQuery ajax)

```
$.ajax({    url: 'http://myawesomeurl.net',    success: function (ajaxResponse) {        //your code start        $('#homePopup').bPopup({                easing: 'easeOutBack', //uses jQuery easing plugin                speed: 550,                transition: 'slideDown'            })        );          //your code end    }});
```


---

Original Source: https://www.mindstick.com/forum/12656/disabling-pop-up-in-javascript

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
