javascript-events

Is there a way to pass a variable to keypressed function?

I am trying to send the document and the control that the key was pressed in to the keypressed function. Here is my code: //Namespace MyExt.BrowserOverlay = { init: function() { var appcontent = document.getElementById("appcontent"); // browser if(appcontent) appcontent.addEventListener("DOMContentLoad...

how to apply event.stopPropagation ?

Hi, Let me explain the problem first. I am using the following UL structure <ul onmouseover="smenu_over(this)" onmouseout="smenu_out(this)" class="sub-menu" style="left:0;"> <li><a href="#">Navigation Item with long text do text wrap</a></li> <li><a href="#">Sub nav item</a></li> <li><a href="#">Sub...

Can't get document.getElementById.getElementsByTagName to work properly

function confirm_results(theform) { var inputsX = document.getElementById(theform).getElementsByTagName('textarea'); for(var iX = 0, nX = inputsX.length - 1; iX < nX; iX++) { text += inputs[iX].innerHTML + ', '; } return text; } Can anyone tell me why this isn't working? I'm trying to find all...

What is the event In Google Chrome API that runs everytime user opens browser ?

I have a Google chrome plugin that has to sustain a connection(BOSH) with a outside server. That forces plugin to fire Connect() everytime browser opened. Stumbling through the API can;t really find event that would do this once and only once when browser is opened. Is there any or should I go in a freaky way ? ...

problem with onBlur event in IE

I have this HTML: <textarea class="question" onBlur="onBlurFun(event); return true;" name="aaa" id="bbb"></textarea> And this function in JavaScript onBlurFun = function(event) { var tgt = $(event.target); alert(tgt.attr('id')); } In IE, tgt is not properly set. What should I do to have access to calling node? ...

Turn a comic strip to an iphone webapp

Hi, I am helping a friend to turn her weekly comic strip into an iphone webapp. Is there any sample app that I can learn how this is done? The comic strip is a new jpeg file every week, usually containing 4 blocks. It is desirable to show one block at a time and use swipe events to move back and forth. Any help is highly appreciated....

Multiple Clicks inside li element

Hi guys, I have the following structure : <li onclick='GetMyTopic({1});' class='SideBarBoxli SideBarBoxLiSelected' id='MyTopics{0}'> <div style='float:right; padding-top:3px;'><a href='{0}'> <span>{1}</span></a></div> <div > <a id='img{2}' onclick='DeleteTopic({0},{1})' href='#'> <img src='../../../images/delete.png' height='16' wi...

how to check the parent window

I am having a problem getting to the parent window. I have a window that has 2 frames...one of the frame opens another window which in returns open a third window. In the third window I want to refresh the very first window by doing this window.opener.window.opener.close(); it only works for non frame setup...what can I use for the fr...

Inter-component communication in javascript

I have a need for inter-component communication in a web application and am considering different ways to accomplish this. I have some ideas, but would welcome other ideas. First, a quick and simple example. I have two separate components on a page that are loaded asynchronously. By component, I mean a chunk of HTML that has a javascrip...

How to avoid input space and special character

I work on asp.net C# Window application .in AspxTextbox i want to avoid space and arrow key and also special character .I want just user can input number 0 to 9 and a to z character ...

jQuery.bind("remove")

Is there a way have an event handler run when a dom element is removed? I have not seen this documented anywhere. It seems it mightt be possible since jQuery is able to remove data and events on element removal. ...

HTML5 WebSockets, onmessage event.data comparison

Hi everybody, i am working on an HTML5-Application which uses WebSockets. My WebSocketServer sends a message to the WebSocketClient. The Client should now, based on the received message, trigger an javascript function. Here is my example-code: socket.onmessage = function (event) { if (event.data == "someAction") { ...

How do JavaScript interpreters/engines work?

Hi, I'm interested to find out how the JavaScript interpreter (engine if you like) works. I'm aware that JavaScript isn't compiled.I have looked at the ECMA specification, but it doesn't explain how the actual engine works. The main reason why I'm asking this is because I'd like to understand why IE7 behaves slightly differently to IE...

Getting back the event handler returns undefined

The following codes don't work: function dnd(){ } var ele = document.getElementById("relative"); ele.addEventListener("click",dnd,false); document.write(ele.onclick); the output is undefined. I guess the output should be function onclick(event){dnd();} What should I do to solve this problem? Any suggestion is appreciated. ...

How to know when an DOM element moves or is resized

I'd like to know if there is a DOM event to listen for that tells me when a DOM element moves is repositioned or is resized on the page. I am not talking about an elements being drag/dropped. An example is if a have a list of three items on a page, and I use JS to remove one of the top two list items from the page (or hide it or whatev...

How can I profile setTimeout functions existance in JS

Hi I am having a problem understanding which function runs (probably in infinite loop) in my JS code. Is there a plug\way to see the list of the setTimeout functions that are running? thank you ...

Trapping CTRL + P in javascript and calling a custom function for printing

Hi, I have a webpage where i show billing information in a pop. This popup is a DIV and not an new window. In that popup there are two div's one is to hold the print and close button and the other is to hold an iframe. Then reason is when the print button is clicked the content of the iframe is printed so that the print and close button...

HTML Form submit event lost if DOM was modified through AJAX

I have a form with input fields and submit button. Each input's blur event is observed (using prototype) and a new Ajax.Request is fired for server side asynchronous validation. The Ajax response text modifies the DOM tree by updating the error texts and error div styles. Everything works fine, except when I left some input element, clic...

Unable to capture Ctrl+Alt+Arrow key event in jQuery

For some strange reasons I can't capture Ctrl+Alt+Arrow key combination inside textarea. Is it some sort of system hotkey that is getting swallowed by Windows? Ctrl+Alt+<Any Letter> and Ctrl+Alt+Shift+Arrow are getting captured fine. $(document).ready(function() { $("textarea").bind("keydown", function(event) { console.log(e...

Decimal check on OnKeyUp event

I have couple of text boxes. In those text boxes I need to check few types. Allow only Numbers and Decimals Ex: 123.2323 //not allowed any characters Allow only 2 numbers after decimal Ex: 123.23 //not allowed any characters and only allowed 2 digits after decimal Allow only 1 number after decimal Ex: 123.2 //not allowed any cha...