javascript

JSON find in JavaScript

Is there a better way other than looping to find data in JSON? It's for edit and delete. for(var k in objJsonResp) { if (objJsonResp[k].txtId == id) { if (action == 'delete') { objJsonResp.splice(k,1); } else { objJsonResp[k] = newVal; } break; } } The data is arranged as list of maps. Like: [{id:value...

Storing form data in a javascript session

Hi there, I was wondering if it's possible to store form data such as 'title' and 'description' in a javascript session? I'm using the uploadify script to have a flash uploader, but the script isn't passing the title and description. This is my code at the moment; <script type="text/javascript"> jQuery(document).ready(function() { ...

Best way to serialize a range of hours to meaningful data

A part of my web app involves creating 'appointments' (shifts) using a drag-and-drop selector for each day. Currently, this data is serialized to something like this: 9,10,11,12,13,14,15,16,76,77,78,298,299,300,301,302,303,304, Where each number represents the nth half-hour of the week (so 304 is the 300th half-hour of the week, or 8a...

Drop Down List background color

Hi is it possible and how to change background color for an item in a drop down list on focus using css or javascript? Thanks ...

Chart controls for ASP.NET

I am looking people's opinion and experience on using chart controls within an ASP.NET application (web forms or MVC) primarily but also in any kind of project. I am currently doing my research and I have a pretty big list of controls to evaluate. My list includes (in no particular order): ASP.NET controls: DevExpress XtraCharts (htt...

Selecting a column (jQuery)

$('.table tbody td:eq(3)').addClass('col4'); ..works, but only selects the first cell, not all cells in the column. ...

in chrome browser trying to refresh one frame from other frame in the same window

I am using this method to fresh other frame in the same window using java script function updateTree(val) { if (val == 1) { parent.frames['left'].location.reload(); } else if(val == 2) { parent.frames['bottom'].location.reload(); } } its working in both IE and Mozilla but is not working in Chrome Browser(3.0.195.38). ...

How can I create a photo slider on iPhone Safari with jQuery?

I'd like to create an product image viewer for an iPhone version of an ecommerce site, and have it behave something like the Photos app. Ideally, you would be able to slide images to move back and forth in the product image gallery. This will all be done in mobile Safari. I did a little experimenting with jqTouch, but its doesn't loo...

Loop over "history" in javascript?

Is there a way to loop over the "history" object in javascript to find a specific page in the history? ...

How can I redirect to IE from other browsers?

Hi there I want to redirect to Internet Explorer from other browsers by JavaScript. How can I do that? ...

Start and Stop a javascript refresh

I have a page that needs to be refreshed every 60 seconds. On this page I am using iBox to popup various items. My problem is that a meta refresh kills the popup which is not wanted. Please keep in mind I have zero to little experience with javascript so my solution may be fundamentally wrong. The solution I came up with is to use javas...

Print large map on Google Maps

Is there any way that we can print a large map with all the pins on google maps? EG: there are around 300 pins with places of interest and can we print out a large map (4000 x 6000) PDF and use A0 printer to print the results? Lets say that the entire UK fits into the A0 page with different pins on the map. Thanks. ...

Using an html button to call a javascript function

I am trying to use an html button to call a javascript function. Here's the code: <input type="button" value="Capacity Chart" onclick="CapacityChart();" > It doesn't seem to work correctly though. Is there a better way to do this? Here is the link:http://projectpath.ideapeoplesite.com/bendel/toolscalculators.html click on the capaci...

Change of <td> height causes hiding of other elements on the page.

Hi, I’m working on my web site. Sometimes I need to change height of table cell in order to fit content in it. I’m doing it with java script as follows: contentCell = document.getElementById(contentId); contentCell.style.height = "180"; The problem is in IE8. When I increase height, the table hides other elements below that is reall...

is this object empty, Javascript

I have an ajax system set up. When the MySQL query returns no data, I need it to pass an empty object back. I create a node called 'data' in the php script and even when the query returns no data I pass $data['success'] = 1. The trick is I can't figure out how to check to see if the query was successful or not. I have tried... // su...

recording durations in milliseconds using jQuery?

I am building an AJAX page that when the user clicks a box, it sends an ajax request and returns a result. This is a very simple game. The users repeatedly click the box, and I need to record how much time has elapsed between each click with a precision of milliseconds. So with my request actually, I will be sending the elapsed time s...

Minify inline javascript during build for ASP.net?

We have a handful of ASP.net pages that include more than 50+ lines of javascript specific to that page. We'd like to minify that javascript during our CruiseControl build process. We already use the YUI Compressor to compress our full javascript and css files. But we can't figure out how to do the Inline javascript. Is there an MSBu...

get and set selected value

REFRASE QUESTION : I have 6 selects. When I select value from select1 I invoke some function from server side and I get JSON array from that function. I get 5 values at most from this array, sometimes I'll get 20,30,40,50,60 but sometimes 20,30 or just 20. These values correspond to select2, select3, select4, select5, select6 option v...

jQuery UI range slider - grab the bar between the handles

Is there any way to modify a jQuery UI range slider so that you can grab the bar between the handles to slide the selected range? If you try to grab the bar, it jumps to one of the handles. This page has an example of the sort of behavior I'm looking for - it's at the bottom. ...

When should I use delete vs setting elements to null in JavaScript ?

Possible Duplicate: Deleting Objects in JavaScript I have a JS object having a large number of properties. If I want to force the browser to garbage collect this object, do I need to set each of these properties as null or do I need to use the delete operator? What's the difference between the two? ...