javascript

Key code check in Javascript not working for IE

I tired to write a function to check key code with javascript. It's working fine for firefox but not IE. Does anyone know what is going wrong with my code? Please see below code for more details. function textCheck(e) { var e = window.event || e alert("CharCode value: "+e.charCode) alert("Character: "+String.fromCharCode(e.charCode))...

jQuery event handlers not firing in IE

I have a list of items on a page with a set of controls to MoveUp, MoveDown and Delete. The controls sit at the top of list hidden by default. As you mouseover an item row, I select the controls with jquery //doc ready function: .. var tools = $('#tools'); $('#moveup').click(MoveUp); $('#movedn').click(MoveDn); $('#delete').click(Dele...

autocomplete search multiple parts of string, then returns the most likely ones

Kind of like this question I have many text snippets that I use many, many, many times a day. I want to build something that can search a database/ preferably a javascript array full of sentence length strings, returning the most likely one. Most autocomplete returns things you type in the sequence you type them. I do not remember se...

Jquery Change Height based on Browser Size/Resize

Hi all, I was wondering if there was a way to determine the height/width of a browser. What i'm trying to do is set a height on a div to 500px when the browser size is 1024x768, and for anything lower i'd like to set it to 400px. Thanks in advance ...

javascript void(0) problem in IE

HI, I am developing a web page using asp.net. I am using some links in my web page. For that I have used some code like this. <a href="javascript:void(0);" onclick="javascript:ChangeLoc('TEST','');">Test</a> and in the ChangeLoc() method I have written __doPostBack event. This works fine in IE7 installed in my machine. But in IE6...

Do you know 1024 Overriding a function error on flex (flash )in action script 3?

In my project i used this below function public function createIconMenu():NativeMenu{ var iconMenu:NativeMenu = new NativeMenu(); iconMenu.addItem(new NativeMenuItem("", true));//Separator if(NativeApplication.supportsSystemTrayIcon){ iconMenu.addItem(showCommand); showCommand.addEventListener(Event.SELECT, onShowCommand)...

Addressing properties of a Shockwave Flash object (MultiPowUpload) in JavaScript

Please pardon the dumb newbie question; I've only been programming Javascript for about 24 hours... :) I have managed (with some outside help) to embed a shockwave flash object into my page - specifically MultiPowUpload 2.1. It's appearing nicely on the page and seems to be functioning correctly; we can take that part as read. Now I'm...

How do I make sure that at least one checkbox is checked?

I am using checkboxes whose values is coming from database. Its name is same but name is fetching like: <input type="checkbox" id="chkBankServices" name="<%=bs.getServiceID()%>"> <%=bs.getServiceDesc()%> through this i am getting the values from the database. Now i have to validate that at least one checkbox should be selected.. If a...

calling javascript in vb.net

Hi, I am calling a javascript in the onclick event in ASP.NET sourcecode, as follows: onclick='open popuplistitems("ct100$contentplaceholder..........") Can you tell me how to do the same in vb.net ? ...

Date validation through javascript

Hello guys, Please help me to solve my problem. I am stuck with a problem in javascript. My problem is that i have to use date validation. I have two date fields and i am putting the validation on both, but the problem is that it is working on one datefield and not in the other one. Like: code of javascript function ValidateDate(DateFr...

In JS, what is this feature called?

I'm trying to learn about this feature of javascript I keep seeing in code, but I don't know the name of the construction to google for... var Stats = { onLoad: function(e) { // content this.variable++; }, variable: 1 }; Is this way of organising functions and variables based on JSON? ...

Positioning an element below another element in Javascript

I'm trying to create a dialog similar to the one that shows when clicking the 'flag' link here on SO (without using JQuery or any other library though). The code below displays a dialog when the Show Dialog link is clicked. The code works very well except one thing which is that when the text of the page is resized, the dialog doesn't d...

Access the control from another file

Hi friends i am doing a project in that i need to disable some controls from antother page. For example i have a button named "View profile" in Mainpage.html . i want to disable the button from Profile.html . please help me to fix this problem. Thanks in Aadvance. ...

Create an Image of a DIV in JavaScript (GIF/PNG)

Hi, I'm wondering is there a JavaScript library available that would allow me to generate an Image from the contents of a DIV. Basically this is required for some Server-Side Printing code, which needs to print a background from the Browser. What I'd ultimately like to do would be encode the DIV contents into PNG format and post up th...

jQuery: Returning the text from first-child or self

I am trying to get the text inside an element and I only want to get the text if it's inside the first-child of a placehoder div or if there are no childrent and it's only text inside. So the two scenarios are: <div id="wrap">text1</div> and <div id="wrap"><b>text1</b><b>text2</b></div> So In both cases I want to get back "text1" I...

onkeyup key-value in Javascript

I have a standard textbox and I've got jQuery on the page. I want to act when the user types a space into the textbox, I am however unsure of how to do this. Can anybody give me a hand with this please? ...

The value of 'this' in a callback function

I have this code for doing an ajax request to a webservice: var MyCode = { req: new XMLHttpRequest(), // firefox only at the moment service_url: "http://url/to/Service.asmx", sayhello: function() { if (this.req.readyState == 4 || this.req.readyState == 0) { this.req.open("POST", this.service_url + '/HelloWorld', true); this...

need to handle special character validation using javascript

Special characters <,>,%,'',"",$,^ are not allowed in a textbox. I need to put a validation check to restrict these characters on submit along with the null check. I wrote entire validation code in a function and calling it on click of submit but the function is not recognised on click. Please help me in this java script to acheive th...

How to "push" updates to individual cells in a (ASP.NET) web page table/grid?

I'm building something similar to a price comparison site. This will be developed in ASP.NET/WebForms/C#/.NET 3.5. The site will be used by the public, so I have no control over the client side - and the application isn't so central to their lives that they'll go out of their way to make it work. I want to have a table/grid that display...

onBecomesVisible in Javascript for clickless pagination?

is there any javascript library that provides me with a custom event as soon as a certain element becomes visible in the browser canvas? the basic idea is, as soon as the last element in a list becomes visible on the screen, i want to load the next 10 elements so that the user does not need to click on the "next page" button. to achiev...