javascript

How can I use Javascript to identify a client?

I have a problem where I cannot identify visitors to my intranet page because their browser is configured to use a proxy, even for the local intranet. I always see the proxy IP and no other details about the client. The SOE that my company uses has the proxy set up already for Firefox and Internet Explorer, and I cannot ask them to recon...

ASP.net 2.0 Gridview with Expanding Panel Rows -- How to build Panel "on the fly"

I'm currently building a Gridview that has expandable rows. Each row contains a dynamically created Panel of Form elements. Right now, I have a javascript function that expands (or in my case, makes visible) the panel when an Image is clicked on the Gridview row. My question is... is there a more efficient way of doing this. Instead of ...

Move the cursor programmatically from one page to other page using JavaScript

Hello, I have 2 pages on the screen (actually more as it is a kind of proprietary web application with a few frames and I cannot figure out actually the whole structure) I enter the search criteria in a page, I press ‘Enter’ on the keyboard , search is executed and the other view is filled with data. There is a button ‘Confirm’ on this...

What is JavaScript's Max Int? What's the highest Integer value a Number can go to without losing precision?

Is this defined by the language? Is there a defined maximum? Is it different in different browsers? ...

How do I imitate the ASP.NET AjaxOptions delegate functions?

When using the Ajax.BeginForm() helper in ASP.Net MVC, I can pass options with names of different functions, for example one to run OnBegin, one for OnSuccess etc. How do these work "under the hood"? The reason I'm asking is that I'm extending this to provide a jQuery based alternative, and I need to figure out how to get from having th...

How to reproduce: Script Error, "Object does not support this property or method."

Can any one give me a scripts (HTML/CSS/Javascript) that can reproduce this error on IE 7.0? I am trying to fix this bug in my page where I get this warning but could not exactly found the problem. Line number does not match with the source either. I thought the better approach would be to create a bug and then work on it incrementally...

How can I reformat form input before POST using Javascript (or Rails)?

I have a field in my form labeled "Name" that will contain both the First & Last name. Our existing dynamic server (to which the form is being POSTed to), expects two separate fields (first name, last name). Can I use Javascript to split the user input into two separate variables before the form is posted to the server? How would I d...

JavaScript & IE7 - Why won't my *.onload = function() { } fire?

I have a gallery I quickly coded up for a small site, and under Firefox 3 and Safari 3 works fine. But when I test on my old best friend IE7, it seems to not fire the imageVar.onload = function() { // code here }.. which I want to use to stop the load effect and load the image. The site is at http://www.stationhotels.com.au/new/?page=a...

Prevent hiding of ModalPopupExtender when ok or cancel is clicked

I am using a asp.net ModalPopupExtender on a page, and would like to prevent the dialog from hiding when the user presses the ok button in certain conditions. But I can't seem to find a way. What I am looking for is something like this ajax:ModalPopupExtender ... OnOkScript="return confirm('You sure?')" ... if confirm is false, then ...

How do I connect multiple sortable lists to each other in jQuery UI?

I'm new to jQuery, and I'm totally struggling with using jQuery UI's sortable. I'm trying to put together a page to facilitate grouping and ordering of items. My page has a list of groups, and each group contains a list of items. I want to allow users to be able to do the following: 1. Reorder the groups 2. Reorder the items within the...

How do I select a single element in jQuery?

I have a table structure that looks like: <table> <tr id="row1"> <td> <div>row 1 content1</div> </td> <td> <div>row 1 content2</div> </td> <td> <div>row 1 content3</div> </td> </tr> <tr id="row2"> <td> <div>row 2 content1</div> </td> <td> <div>row 2 content2</div> </td> <td> ...

How can I communicate over TCP sockets from JavaScript?

I'm thinking about how limiting it is for AJAX apps to have to poll for updates, when what would be ideal is for javascript to be able to set up a real two way connection to the server. I'm wondering if there is some method of integrating javascript with a browser plugin that can make a tcp connection so that I could pass data into and o...

How do I use the value of a variable at declaration time in a JavaScript anonymous function?

Hi, This is a really basic question but... I have some code like this var arr = Array('blah.jpg','ha.jpg'); for (var i=0; i<array.length; i++) { $('div#blah' + i).click(function() { $('img').attr('src', arr[i]); }); } This should bind the div with id="blah0" to change all images to 'blah.jpg' when clicked. Similarly, ...

jQuery slideUp().remove() doesn't seem to show the slideUp animation before remove occurs

I have this line of JavaScript and the behavior I am seeing is that the selectedLi instantly disappears without "sliding up". This is not the behavior that I expected. What should I be doing so that the selectedLi slides up before it is removed? selectedLi.slideUp("normal").remove(); ...

Learning how to use AJAX with CodeIgniter

It's kind of embarassing that I find it so difficult to learn JavaScript, but .. Let's say I have a really simple controller like this: class front extends Controller { public function __construct() { parent::Controller(); } public function index() { //nothing! } public function test () { ...

jQuery Graceful Degradation

I want to spruce up some areas of my website with a few jQuery animations here and there, and I'm looking to replace my AJAX code entirely since my existing code is having some cross-browser compatibility issues. However, since jQuery is a JavaScript library, I'm worried about my pages not functioning correctly when JavaScript is turned ...

Javascript "onMouseOver" triggering for children?

I can't tell if this is a result of the jQuery I'm using, but this is what I'm trying to do: <div class="info" style="display: inline;" onMouseOut="$(this).children('div').hide('normal');" onMouseOver="$(this).children('div').show('normal');" > <img src="images/target.png"> <div class="tooltiptwo" id="tooltip" style="font...

fastest way to detect if a value is in a set of values in Javascript

I have a set of String values in Javascript, and I need to write a function that detects if another specific String value belongs to this set or not. What is the fastest way to achieve this? Is it all right to put the set of values into an array, and then write a function that searches through the array? I think if I keep the values sort...

Password checking in dojo

I want to check that two passwords are the same using Dojo. Here is the HTML I have: <form id="form" action="." dojoType="dijit.form.Form" /> <p>Password: <input type="password" name="password1" id="password1" dojoType="dijit.form.ValidationTextBox" required="true" invalidMessage="Please type a p...

Firefox style onclick arguments in IE

In firefox when you add an onclick event handler to a method an event object is automatically passed to that method. This allows, among other things, the ability to detect which specific element was clicked. For example document.body.onclick = handleClick; function handleClick(e) { // this works if FireFox alert(e.target.classN...