Avatar of idusty
idusty

asked on 

How to close ajax requested page

Hi Experts,

I have an ajax request in order to load a php file, which essentially displays a pop-up. I use the code below:
$('input[name="rsrvButton"]').click(function() {
  mygetrequest.open("GET", "includes/content/bs/b_popup-reserve.php?bookingData=" + $(this).attr('id'), true);
  mygetrequest.send(null);
  e.preventDefault();
});

Open in new window


It works great, but how could I close it in the same elegant way as I open it? Maybe something like the following?
mygetrequest.close()

Open in new window


Thanks in advance.
AJAXJavaScriptPHP

Avatar of undefined
Last Comment
Zyloch
ASKER CERTIFIED SOLUTION
Avatar of Zyloch
Zyloch
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
JavaScript
JavaScript

JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.

127K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo