7 Replies - 944 Views - Last Post: 01 November 2013 - 03:29 AM

#1 tash876  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 23-November 11

Unload external page from a div tag

Posted 01 November 2013 - 02:46 AM

I am trying to unload 'signup.php' from the 'overlay_div' tag that is found in the index.html page. Mind I say that there is a close button within the 'overlay_div' tag which disappears whenever 'signup.php' pops up. I have no idea of how to make the close button appear or to unload the external page.
// Javascript Document
$(document).ready(function(e) {
                $("#signuplink").click(function(){
			$(document.getElementById("overlay")).fadeIn("slow");
			$(document.getElementById("overlay_div")).fadeIn("slow");
			$(document.getElementById("overlay_div")).load("signup.php");
			$(document.getElementById("close")).children().show();
		});
		
		$(document.getElementById("close")).click(function(){
			$(document.getElementById("overlay_div")).unload("signup.php");
			$(document.getElementById("overlay_div")).fadeOut("slow");
			$(document.getElementById("overlay")).fadeOut("slow");
			
		});
		
});



Is This A Good Question/Topic? 0
  • +

Replies To: Unload external page from a div tag

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3577
  • View blog
  • Posts: 10,442
  • Joined: 08-June 10

Re: Unload external page from a div tag

Posted 01 November 2013 - 02:57 AM

Quote

Mind I say that there is a close button within the 'overlay_div' tag which disappears whenever 'signup.php' pops up.

well, since load() replaces all content within the designated element, including the button. hence you would either have to re-insert the button or to modify the content sent from the server to include the button.
Was This Post Helpful? 0
  • +
  • -

#3 tash876  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 23-November 11

Re: Unload external page from a div tag

Posted 01 November 2013 - 03:04 AM

I tried placing the button elsewhere but nothing happened. I am not receiving or sending anything from or to the server.

This post has been edited by Dormilich: 01 November 2013 - 03:08 AM

Was This Post Helpful? 0
  • +
  • -

#4 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3577
  • View blog
  • Posts: 10,442
  • Joined: 08-June 10

Re: Unload external page from a div tag

Posted 01 November 2013 - 03:14 AM

Quote

I am not receiving or sending anything from or to the server.

.load("signup.php") definitely does an AJAX call (unless the overlay_div element does not exist)


Quote

I tried placing the button elsewhere but nothing happened.

since I don’t know what the button is supposed to do (code-wise) …

PS. .unload("signup.php") is invalid. there are 2 different .load() functions in JS (one for the load event and one for the AJAX call) but only one .unload() function (for the unload event).
Was This Post Helpful? 0
  • +
  • -

#5 tash876  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 23-November 11

Re: Unload external page from a div tag

Posted 01 November 2013 - 03:18 AM

the close button is to make the the 'overlay' div tag and the 'overlay_div' div tag disappear. The close button works fine when I do not load 'signup.php' in the 'overlay_div' div tag.
Was This Post Helpful? 0
  • +
  • -

#6 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3577
  • View blog
  • Posts: 10,442
  • Joined: 08-June 10

Re: Unload external page from a div tag

Posted 01 November 2013 - 03:24 AM

Quote

the close button is to make the the 'overlay' div tag and the 'overlay_div' div tag disappear.

how?
Was This Post Helpful? 0
  • +
  • -

#7 tash876  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 23-November 11

Re: Unload external page from a div tag

Posted 01 November 2013 - 03:28 AM

Basically I used to the two divs to create an two overlays to give a pop up effect. What is the correct way to open the signup.php into the div
Was This Post Helpful? 0
  • +
  • -

#8 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3577
  • View blog
  • Posts: 10,442
  • Joined: 08-June 10

Re: Unload external page from a div tag

Posted 01 November 2013 - 03:29 AM

Quote

What is the correct way to open the signup.php into the div

the one you already have.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1