Pop-Up Closure Detection

Nov 21, 2009

I'm using the code below for the "launch page" to open a JS window and know when it has been closed, and than execute some other code that should be run after the pop-up closes.

javascript Code:

This works, and does exactly what I want. Do any of you JS experts see any reason for concern? Anything that makes it suboptimal?

View 3 Replies


ADVERTISEMENT

Object Detection Vs. Browser Detection

May 5, 2003

I'm going to make an attempt at coding a nice tree menu that is decent with browser support.

I want the tree to be displayed on all browsers (well, within a decent range). Of course, on older browsers, the menu won't be as functional.

Now, I'm going to be combining the javascript with a server-side language (asp.NET) and I'll be able to do some basic browser detection on the server.

But, I read about javascript object detection and am wondering how well that works exactly.

Like, what if a browser that doesn't support objects period tries to run some object detection code? Also, which browsers support user defined objects?

See, I'm thinking of breaking down the script in 3 categories. Browsers that won't get any javascript... these would be the browsers that don't support object detection, browsers with basic javascript... with these I would be able to code my own object and I would test for different features. And then there would be the browsers that can run it all.

So, basically, my question is what browsers support what features and how should I break down my code between them? A long time ago (back in the Netscape 4 / IE4 days) I did some javascripting, but since then I haven't really done any. I remember that NS4 didn't support div tags but supported layers... anyway, it got really messy.

View 4 Replies View Related

How To Set Flag Using Closure

Oct 7, 2011

I would like to set a flag using a closure so that the internal value of that closure is preserved for me to retrieve it when different events occur. It is one of those times where lack of block scope will stop me from doing what I want to do unless I can set a boolean and preserve its value in a function.

View 9 Replies View Related

Control Over IE Window Closure

Oct 31, 2006

I am currently strungling with the fact that I want to control the
browser closure. In fact, I have a webbased application in which I use
a wizard. Ones the wizard starts, a lock is set on specific objects in
the db. On all pages of the wizard, the user get the possibility to
exit the wizard by clicking on a custom "Exit" button. That way, I know
that the user has left the wizard and that way I can unlock the locked
objects in the db again.

So far, so good. But users are used to close browser windows by
clicking on the "X" in the titlebar. If they close a window that way,
the locks aren't unset and no other user may start the wizard again. If
I should know that he had clicked on the "X", I could unlock the
objects.

I have searched a lot on the net but all results aren't sufficient for
me.

Some solutions which don't work:

1) onunload event: =Also called when the window is refreshed or
forwarded.

2) "titlebar = no" property while opening the first page of the wizard,
is not working (the titlebar is still enabled). And even then, the
users can close the window by clicking CRL-F4. This key combination
isn't disabled by the "hotkeys = no" property.

Note: if the client's pc crashes or if the user kills the wizard
process via the task manager (exceptional cases), they have to call
maintenance to reset the locks. This is a requirement, defined by
bussiness.

View 4 Replies View Related

Onfocus Closure Scope Error

Aug 19, 2006

In my UI framework, I have an event handler - just like many frameworks do. My handler is a static object, and contains methods to take care of things like mouse events, etc. However, upon adding a method to handle onfocus today, I ran into a very odd problem in Firefox. I've put together an example page that generates the error:

View 14 Replies View Related

Closure Works In Constructor But Not In Prototype?

Jan 6, 2011

I'm not sure why this: Code: console.log(instance2.getAnotherKey()()); returns Object { a = "a" } when I clearly reassigned the value of the a property. Reassigning the property caused change in this line:

Code:
ref.a = 'abc'; console.log(inst.getZ()); //Object {a="abc"} So why does it work when you call an instance method in the constructor (e.g. this.getZ()) but doesn't work when you call the instance method in prototype?

[Code]...

View 3 Replies View Related

Share Variables Between InnerFunction And Closure Scope?

Sep 22, 2010

I had a original function in this format/syntax:

Code:
GlobalFunction(){
InnerFunction(){
// ... long definition here ...

[Code]....

Other words the innerFunction behaves like it is global and has not shared variables with myClosure!

View 14 Replies View Related

Detecting Popup Menu Closure From MAIN Window?

Sep 20, 2010

when a user clicks on a link, a new window opens. what I want to do is that if the user closes that popup but click on that same link again, the window should open..

Code:
<script language="javascript">
var winOpen = "";

[code]....

View 1 Replies View Related

JQuery :: Delay Dropdown Menu Closure When Mouse Moves Off Of It?

Feb 18, 2011

I'm using the apycom jquery menu style 1 (dim grey)URL..It's a great looking menu but does anyone know how to 'delay' the dropdown menu closure when your mouse moves off of it?I can change the speed of the menu opening and closing, but not can't find a way to delay.It's too easy for visitors to 'slip' off the menu and if you have two child menu's, it get frustraing if you drill down to the secon child menu and slip off. You have to go back to the top menu and start again.

View 2 Replies View Related

Jquery :: Grouping Existing Top Level Functions Inside Closure

Nov 24, 2009

I'm trying to group some existing top-level functions inside a closure (to avoid polluting the global namespace) but I'm not quite getting it to work. First, all the JS works outside my anonymous function, but once I put it in the anonymous function I get an error of "crossfade is not defined". I'm not quite getting why the the setInterval/crossfade works outside the anonymous function but not inside. Anything inside start() should be able to see vars/functions outside start() and it should all be protected in the closure created by the top-level anonymous function? I'm not trying to access anything *within* crossfade(), I'm just trying to execute it.

Code:
(function($) {
//vars up here that internal functions can access
//also using some jquery inside here, so using $
function crossfade() {
//body here
}
//other functions
function start() {
//body here
cInterval = setInterval('crossfade()', 5000);
}
})(jQuery);

View 3 Replies View Related

Os Detection

Jul 23, 2005

I have a page with a script that works only in IE and as I heard from
feedbacks it doesn't run under IE on Mac.

I have browser type redirect script for that page that seems to be
working fine except it doesn't detect the OS ( IE on Mac just gives
blank page). Can someone add to the code that I would give me one page
for IE on Windows and another one for all others? Code:

View 1 Replies View Related

Self Detection

Jul 20, 2005

I have on different form elements an onChange routine.

Now I was wondering how I can see which element fired the routine. Can I
write something like "if (self.name=='elementA')"?

View 1 Replies View Related

Browser Detection

Jan 30, 2007

So I need script, which will detect users browser, and if browser will be IE, then show some link in content, if browser is FireFox or Opera, then hide that link. Link looks like:

<tr>
<td align='center' valign='top'><a href='/' target='_blank'>link</a></td>
</tr>

View 4 Replies View Related

IP Detection Script

Sep 28, 2005

I would like to have my page display the IP address of the user when the page loads. I have heard of the IP detection scripts when using the
"var ip = '<!--#echo var="REMOTE_ADDR"-->" attribute to make a window or alert popup and display the IP of the user, and I have also come some scripts that display the IP in the status bar. However, I want the current IP adress to be shown on the page itself, part of the <Body>.

View 2 Replies View Related

Object Detection

Mar 23, 2006

function doDOMStuff() {
var el = document.getElementById('myElId');
// object detection
if(!document.getElementById) return false;

//or

if(!document.getElementById) return;

// doStuff
}

View 5 Replies View Related

Cookie Detection

Jan 18, 2004

I currently have a site which uses cookies, the problem is that I want it to detect if the browser being used has cookies enabled. I know you can accomplish this by setting a cookie in JavaScript and testing for it (i don't know how to do it, though), *BUT* I need the script to be compliant with all (or at least most) browsers. By this I mean, Mozilla, Firebird, Opera, IE, Netscape, and anything else you can think of.

View 2 Replies View Related

Object Detection For IE 6 Only

Oct 3, 2004

Is there a simple object detection to sniff for IE 6 only ( not IE 5.5 or lower ) ?

View 2 Replies View Related

Plugin Detection For IE 5.5?

Apr 23, 2001

How do you find out if a certain Plugin has been installed in IE 5.5 using Javascript?

I know that in netscape you can use navigator.plugins so I was hoping there was something as easy as this.

View 2 Replies View Related

Javascript Browser Detection

Jul 23, 2005

I have some html code i would like to be printed to the page only if the
browser has javascript enabled. I have tried to use document.writeln()
but the string i want to print bot contains some ' and " in it. I don't
know how to set the delimiters of the string that is passed as argument
so that i don't get an error in the page.

View 1 Replies View Related

Browser Version Detection: How?

Jul 23, 2005

I've have got this script, the only thing I want to be changed is the first part. It has to detect IE version 6 instead of just "Microsoft Internet Explorer". Can somebody help me out? I tried "Microsoft Internet Explorer 6" but that doesn't work.

<SCRIPT LANGUAGE="Javascript">
<!--
bName = navigator.appName;
if (bName =="Microsoft Internet Explorer") {
document.write('<link media="screen" rel="STYLESHEET" type="text/css"
href="stylesheet1.css">')
} else {
document.write('<link media="screen" rel="STYLESHEET" type="text/css"
href="stylesheet2.css">')
}
//-->
</SCRIPT>

View 8 Replies View Related

Window Scroll Detection

Jul 23, 2005

How to detect that user started to scroll the page ? Separately vertical and
horizontal scroll. Is it possible ?

View 2 Replies View Related

Popup Blocker Detection

Jul 23, 2005

We have a database application that runs in a popup Internet Explorer
application window. The reason for this is to isolate the casual user
from the address bar and the typical IE navigation buttons.

The application has a browser test page that displays an error message
when a popup blocker is found and opens a popup page stating the test
was successfull if there is no popup blocker.

Is there a reliable method (preferably javascript) for detecting the
major popup blockers (SP2, AOL, Yahoo, Google, MSN, etc.)? We currently
have a temporary solution in place which works OK but we would like to
have a better solution.

We have already reasearched this on the net, as well as spent a few
hours trying different options.

The application is designed to run on MSIE only so the solution can be
Explorer specific.

View 26 Replies View Related

Shift Key Detection On Input

Mar 23, 2006

I'd like to detect the shift key when a button is "clicked" in
Firefox/Mozilla. If the button is clicked with the mouse, no problem.
However, if the onclick event is keyboard originated, then my method is
not working. Same thing for SELECT elements.

The simple web page below shows the issue. Click with the mouse while
holding down the shift key, and the Shift key's status registers.
However, use Shift+Alt+o, or either (while the button has focus)
Shift+Space or Shift+Enter to kick off the onClick event and the shift
key is not detected. Works fine with IE 6 on my Win XP Pro. Code:

View 7 Replies View Related

Browser Detection Code

Jul 20, 2005

I want to know the height of the viewable portion of a page (minus scrollbar)
in Opera and Mozilla.

For Opera, I could use document.body.clientHeight. Unfortunately, this won't
work in Mozilla because Mozilla also subtracts the sizes of the top and bottom
margins.

For Mozilla, I could use document.documentElement.clientHeight.
Unfortunately, this won't work in Opera because Opera returns the height of
the entire page, not just the viewable portion.

So I have two options:

1) Use browser detection code to determine if the user is running Opera or
Mozilla, and then use the appropriate clientHeight code.

2) Use window.innerHeight. This is supported by both Opera and Mozilla,
however it returns the height of the viewable portion of the page *including*
the scrollbar. Is there any way to determine the width of a scrollbar? If
not, then I would have to make an assumption and subtract the hardcoded width
of the scrollbar from window.innerHeight... but only if the scrollbar is
present, is there a way to determine that?

View 4 Replies View Related

Browser Size Detection

Jan 7, 2006

Well after playing around a little I have created a solution that works although it appears a little chunky. The problem was finding the browser size to use the width as a variable for size conditional aspects to a site. Code:

View 8 Replies View Related

Browser Detection Script (+)

Jan 28, 2006

I am looking for a detailed and correct browser detection script. Preferable a one that does not detect based on the UA string, but detects using DOM model or tests for functions, etc...

I'd like it to return OS, Browser and version as a separate variables.

View 14 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved