Window.event.srcElement

Jul 23, 2005

I have this IE specific bit of code for finding the originating node:

var obj=window.event.srcElement;

How do I do that cross browser (Opera, NS, Safari...)? Is there a standard
DOM method?

I seem to recall NS worked something like this:

onmousedown=handleThat;

function handleThat(e){
e.target;
// but then I'd have to take the parent to get the same node as IE
}

Event handling makes my head spin!

View 5 Replies


ADVERTISEMENT

[split] Window.event.srcElement Not Working In FF?

Jun 24, 2010

//This is my html code

<INPUT TYPE="Button" CLASS="Button" onClick="delRow()" VALUE="Delete Row">

//this is javascript function for deleting a row
function delRow()[code].....

View 8 Replies View Related

Event.srcElement

Jan 27, 2006

Can anyone explain why this just alerts [object]. I'm trying to change the background of a tr when it's clicked on, I only added in the alerts to see why it wasn't working.

<tr class="a"

function sel() {
var x = event.srcElement;
alert(x);
}

Is there a better method?

View 1 Replies View Related

Event.srcelement Not Working For My Object

Nov 13, 2005

This is my object elobj.

elobj=el.document.frames[fIDx].document.body
elobj.onresizeend=doElResizeEnd

When some one resize image element the doElResizeEnd function
start's .But I get "Require object" error from "var el= event.srcElement;"

function doElResizeEnd()
{
var el= event.srcElement;

if( el.type=='image')
{
alert(el.name)
alert(""+el.width)
alert(""+el.height)
}

alert("doElResizeEnd");
}

View 6 Replies View Related

Cross-browser Alternative To Event.srcElement?

Mar 23, 2010

When you click on the "details" link, a modal window pops up with the job info.This works in IE, but nowhere else. My js skills are shaky, at best, but I did figure out that event.srcElement is IE only and that there are better, modern methods of achieving this.Problem is, I don't know how to implement them in this instance.How can I rewrite this so the modal window functions correctly in IE, FF, etc?Here's the code:

Code:

function displayDetails(num,ctrl)
{
for(var i=0; i<details.length; i++)[code]...

View 5 Replies View Related

Child Window Close Event - Opening Another Link In A Separate Window Using Window.open()

Jan 29, 2010

I have a HTML and I am opening another link in a separate window using window.open() . The child window is something like 'http://yahoo.com' which is out side html. I need to refresh the parent window when the child window is closed.

View 4 Replies View Related

Mozilla Equivalent Of SrcElement?

Apr 6, 2011

Mozilla-equivalent of the following line of code:

document.getElementById('editorContent').contentWindow.event.srcElement.href

The purpose of this line is to get the "href" value of a link when clicked on inside a content-editable iframe.I have the function working perfectly in IE, but not having much luck with Mozilla browsers.

View 9 Replies View Related

E.srcElement And E.target Return The Wrong Element

Aug 16, 2010

In this case the e.srcElement/e.target should return 'home' or 'about', but instead one of the two layers inside 'home' or 'about' will be returned. And these dont even have a onmouseover attribute! The following page is specially made to make it easy to fix the bug if you know how :-)[URL]

View 8 Replies View Related

Window.resizeTo() Inside A Window.onResize Event Handler Function?

Apr 23, 2011

I want to preserve a 16/9 aspect ratio to the window after any resize, making the width a function of the height.

As I have a window.resizeTo() inside the window.onresize event function, the infinite loop is served. How may I quit it?

<html><head><title>Title</title><script languaje="javascript">
const c_ra=16/9;
window.onresize = function WindowReSize() {
var myWidth = 0, myHeight = 0;

[Code].....

View 2 Replies View Related

Capture Child Window Close Event In Parent Window?

Feb 1, 2010

I have an HTML page where I am opening a child window using window.open. the child window is something like yahoo.com. I want to refresh the parent window when the child window is closed.

View 1 Replies View Related

Returning "Label" Value With SrcElement

Feb 5, 2007

If I am using srcElement (or "target" for non-IE models) to return
various properties of an object I have clicked on, can I access for
"label for" value in any way? I'm thinking, for example, of an input
text box like this:

<label for="fred">Username:</label>
<input type="text" name="hello" id="hello1" size="10">

Now, once a function has:

var obj=event.srcElement || event.target;

.... at the top, I should be able to access obj.name and get "hello"
etc, but how can I access the label value of "fred"? I did try
obj.label but it didn't work...

View 4 Replies View Related

Window Close Event

Jul 23, 2005

<script for="window" event="onbeforeunload">
alert('Im closing');
</script>

View 3 Replies View Related

Popup Window Blur Event

Jul 23, 2005

I'm triing to write script that close popup window, when user click outside the popup. Script below is working fine in firefox (v1.0.3), but not in IE.

I tried also to print hello but still the same problem firefox OK IE not. I think the problem is in event capture, but I can't fix it.

My script:
fotowin = window.open("", "foto", "width =100,height
=100,location=no,menubar=no,directories=no,toolbar =no,scrollbars=no,resizable=no,status=no");

fotowin.onblur = closeWin;
if (fotowin.captureEvents) {
fotowin.captureEvents(Event.BLUR);
}

function closeWin() {
fotowin.close();
//fotowin.document.write("hello");
}

View 2 Replies View Related

Gecko DOM Window Onclose Event ?

Dec 3, 2005

I tried to use it but i guess i failed... here is a code:

<html>
<head>
<title></title>
<script type="text/javascript">
function closedWin() {
confirm("close ?");
return false; /* which will not allow to close the window */
}
if(window.addEventListener) {
window.addEventListener("close", closedWin, false);
}

window.onclose = closedWin;
</script>
</head>
<body>

</body>
</html>

View 6 Replies View Related

Window Unload Event Not Firing

Oct 12, 2011

I have aded window unload event handler to my code. my page calls some function that takes few secs and page then loads in 5-6 secs. while ths page is loading, if user clicks 'x' on browser window, then code inside unload event handler doesnt get executed. if user waits for page to be loaded fully and hten clicks 'x', then unload event handler gets executed. but i want if during loading user decides to click 'x' button, then also unload handler shold get exucted.

I am pasting a sample code that simulates my situation:

View 1 Replies View Related

Fire An Event On A Div When Div Come To A Screen Window

Mar 31, 2010

I need to fire an event from a div when div come to a screen window of user mean as when he scroll down the page then which ever the div comes it should fire an event for example say i have a page in that page i ahve 50 div and each div have 50 images so now say on page load 1st image is load, now when i scroll down and as soon as second dive come to screen second image get loaded so i need to know how i came to know that particular dive come in screen

View 3 Replies View Related

Window - Event Is Not Working In Firefox

Oct 20, 2009

My code below is working in IE but not Firefox:

[Code]...

View 5 Replies View Related

Window.event Good For IE But Not Netscape/Firefox

May 8, 2006

I am try to detect the mouse pointer by

var event = window.event;


var x = event.pageX;
var y = event.pageY;

This is working fine in IE, but in
Netscape/Firefox where event return undefined.

Can someone tel me how to detect mouse pointer
in Netscape/Firefox?

View 6 Replies View Related

JQuery :: Handling Window.change Event In IE

Jan 8, 2010

i'm trying to do some event delegation, and i can't seem to get the onchange event working in IE. i've tried:

$(document).change(function () { alert('fuck. me. IE sux'); }); $(document.body).change(function () { alert('fuck. me. again'); });

and later i have:

<select id="aSelect"> <option value="0">a first option</option> <option value="1">a second option</option> <option value="2">a third option</option> <option value="3">a fourth option</option> </select>

but this doesn't work in IE. i've also tried to wire these up manually: document.body.onchange = function (e) { alert('foo); }; and document.onchange, but those don't work either. what's the story here (other than the fact that IE is sucking balls)?

View 5 Replies View Related

JQuery :: $(window).resize Event Does Not Fire In IE8?

Apr 30, 2009

I am posting this question a second time and apologize ifsomeone answered it in the other thread - I cannot find the postanywhere on this list.

$(window).resize(function(){
alert("Stop it!");
});

[code]....

View 1 Replies View Related

JQuery :: Window.Unload Fires On Every Event

Aug 25, 2011

I am using window.unload for some use case in my code. But windows.unload fires on every event. I know to controller it on event like button click or link, but how do I prevent Unload event to fire on refresh or back button event?

View 4 Replies View Related

Practical Use Of Window Focus And Blur Event?

Aug 15, 2011

What is the practical use window.focus() and window.blur()?

View 2 Replies View Related

Access A Remote Window's Onload Event?

Dec 7, 2009

If I use a window opener to open a new window, is there a way to detect that the new window is finished loading before carrying out some other directive in the opener window? Can I access the remote window's onload event from the opener window? I need to know that the website has loaded before moving to the next page. something like:

remoteWindow.onload = goToPage(url);

View 2 Replies View Related

Adding Window Event Listener In Loop?

Sep 19, 2011

I am trying to add a window event listener on some links in a loop instead of doing them one by one. I've tried

function setListeners (){
for (var i = 0; i < document.links.length; i++) {
src=document.links[i].href;
document.links[i].onmousemove=changeIframeSrc(src, 'solid',1, event);
document.links[i].onmouseout=changeIframeSrc(null,'none',0,event);

[Code]...

View 17 Replies View Related

Call Window.open() From A Keypress Event?

Nov 11, 2007

I've got a script which is called by a keypress event, something like this:

<html>
<head>
<script type="text/javascript">
function respondToKey(e) {
keyPressed = String.fromCharCode(e.which);
if(keyPressed == 'g'){
alert('you pressed the g key');
window.open('http://google.com');
}
}

</script>
<title>Untitled</title>
</head>
<body onkeypress="respondToKey(event)">
hit the g key to open a google window
</body>
</html>

when you hit the right key, the alert appears, but the window.open() never happens. There's not even a message in the Error Console, just nothing.

Is this a security feature? Any way I can get around it? And, if it's a security feature, is the fact that it fails silently with no error message also a security feature? Because it's rather annoying.

View 2 Replies View Related

Way To Attach Onclick Event When Window Is Loaded

Jun 8, 2009

This is the html with the link list,

Code:
<div id="logo">
<ul>

[code]....

View 2 Replies View Related







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