Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-03-2012, 12:51 PM   PM User | #1
sorlaker
Regular Coder

 
Join Date: Dec 2009
Posts: 167
Thanks: 23
Thanked 1 Time in 1 Post
sorlaker has a little shameless behaviour in the past
Jquery - How to run script after window.open loads?

How can i run a script after the window.open loads completely?
sorlaker is offline   Reply With Quote
Old 01-03-2012, 12:56 PM   PM User | #2
Amphiluke
Regular Coder

 
Amphiluke's Avatar
 
Join Date: Jul 2009
Posts: 312
Thanks: 3
Thanked 89 Times in 89 Posts
Amphiluke is on a distinguished road
The window.open() method returns a reference to a window object. You may use it to add a "load" event handler.
Code:
var wnd = window.open("url.html", "", "");
wnd.onload = function() { alert("complete"); };
__________________
I am still learning English
Amphiluke is offline   Reply With Quote
Old 01-03-2012, 01:19 PM   PM User | #3
sorlaker
Regular Coder

 
Join Date: Dec 2009
Posts: 167
Thanks: 23
Thanked 1 Time in 1 Post
sorlaker has a little shameless behaviour in the past
Can i make a statement with that?

like

Code:
if (win.onload == true){

}
sorlaker is offline   Reply With Quote
Old 01-03-2012, 01:34 PM   PM User | #4
Amphiluke
Regular Coder

 
Amphiluke's Avatar
 
Join Date: Jul 2009
Posts: 312
Thanks: 3
Thanked 89 Times in 89 Posts
Amphiluke is on a distinguished road
Code:
var wnd = window.open("url.html", "", "");
wnd.onload = function() { wnd.wndLoaded = true; };
// ...
if (wnd.wndLoaded === true) {
  // ...
}
?
__________________
I am still learning English
Amphiluke is offline   Reply With Quote
Old 01-03-2012, 04:20 PM   PM User | #5
DanInMa
Senior Coder

 
DanInMa's Avatar
 
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,335
Thanks: 13
Thanked 207 Times in 207 Posts
DanInMa is on a distinguished road
since you asked about jquery specifically : http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
__________________
- Firebug is a web developers best friend! - Learn it, Love it, use it!
- Validate your code! - JQ/JS troubleshooting
- Using jQuery with Other Libraries - Jslint for Jquery/other JS library users
DanInMa is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:54 AM.


Advertisement
Log in to turn off these ads.