Tag: javascript events

onkeyup function javascript

Possible Duplicate: Throttle AJAX Request On KeyUp and Paste Events Let’s say I have an inputbox in which I have called ajax function on onkeyup. When the user enters any value in the textbox, the value will pass through ajax function and write on image using gd. But I have problem that when user type […]

Disallowed methods in Javascript

I am learning Javascript and in the process, I found that certain operations are not allowed in Javscript which are fairly common in general programming. For example, it is not possible to control a user’s mouse pointer in Javascript due to obvious security reasons, see Move Mouse Cursor Javascript. I would like to know of […]

how can i send the data to another page without appending it in url?

i have a scenario where user when click on a link, he is directed to a page in which i want to add a code to fetch a variable and redirect to another page. .i.e. user click on <a href=”sample.tpl”>click here</a> on sample.tpl i want to write a code to redirect him to another page […]

Javascript IE error: 'target' is null or not an object

document.onkeydown = function(event) { var tagName = event.target.tagName; if (tagName != ‘INPUT’ && tagName != ‘TEXTAREA’ && !event.alt && event.control) { if (event.ctrlKey && event.keyCode == 37) { if (_this.currentPage > 1) { window.location.href = _this.baseUrl.replace(/%page%/i, _this.currentPage + 1); } } else if (event.ctrlKey && event.keyCode == 39) { if (_this.currentPage < _this.pagesTotal) { window.location.href […]

How can I check that a key has been pressed?

Well I searched on google but still didn’t found the answer I was looking for. I want to check if the user pressed a key, something like this – if(document.onkeyup) { // Some Stuff here } I know I can do this, this way – document.onkeyup = getKey; But the function getKey cannot return values. […]

How do I create a deeplink to a subsection of a webpage?

Does anyone know how I can create a deeplink to a subsection of an individual webpage? Wiki seem to have it cracked but I can’t seem to find the answers anywhere on the web. PS keep it simple!

Cross browser-window events?

Is it possible to fire events picked up by a separate browser window? With javascript perhaps. i.e. if my website opened up another window to display summary product information, would it be possible to notify that window to update when a different product is selected in the main window? Needs to work in IE, but […]

jQuery(document).on ('focus')?

Whenever the user focuses on clicks on an input, I want to trigger a method. I have the following code: jQuery(document).on(‘focus click’, function(e){ console.log(“focused on ” + $(e.target).attr(‘id’)); }); But whenever I focus on an element it just gives focused on undefined. What’s wrong with this code?

preventDefault() not working in a input type text

This is my code: $(‘#Login’).keydown(function(e){ if(e.which == 32){ alert(“enter”); this.preventDefault(); } }); This code doesn’t work but sends the alert $(‘#Pwd,#Pwd2’).on(‘keydown’,function(e){ if(e.which == 32){ e.preventDefault(); } }); And this code works. I do not understand why.

How to use JavaScript to hide a text area

when Click on button textarea appear allowing the user to type the message .after type a message i want textarea to hide. Can any one help me how to hide the textarea after entering the message. This my javascipt code: <script> function showDiv1() { document.getElementById(‘welcomeDiv1’).style.display = “block”; } </script> This my html code: <div> <span […]