javascript

How do I get the same buttons as Youtube?

http://www.youtube.com/ You see the "search buttoN". it's really nice. ...

Loop through JSON data Associatively

Hello all, How can I loop through this json data without referring to the data items by a number. I would like to use it as an associative array. I have this so far: $.post('/controlpanel/search', { type: type, string: string }, function(data){ $.each(data, function() { $.each(this, function(index, itemData) { ...

Why does a checkbox's "checked" attribute return the opposite of it's actual value on click event?

I've got the following HTML <li><input type="checkbox" /><label>This is the label!</label></li> I bound a click event to the li, and let the click event bubble up to the li before doing anything else. $('li').each(function(i){ var item = $(this); var checkbox = $("input[type='checkbox']", item); item.bind('click', function(e){...

Adding ID's to google map markers

I have a script that loops and adds markers one at a time. I am trying to get the current marker to have an info window and and only have 5 markers on a map at a time (4 without info windows and 1 with) How would i add an id to each marker so that i can delete and close info windows as needed. this is the function i am using to set th...

Programming pattern to flatten deeply nested ajax callbacks?

I've inherited JavaScript code where the success callback of an Ajax handler initiates another Ajax call where the success callback may or may not initiate another Ajax call. This leads to deeply nested anonymous functions. Maybe there is a clever programming pattern that avoids the deep-nesting and is more DRY. Also, there is the proble...

How to Put Javascript into an ASP.NET MVC View

I'm really new to ASP.NET MVC, and I'm trying to integrate some Javascript into a website I'm making as a test of this technology. My question is this: how can I insert Javascript code into a View? Let's say that I start out with the default ASP.NET MVC template. In terms of Views, this creates a Master page, a "Home" View, and an "Abo...

Does disabling third party cookies also disable cookies created by third party javasript?

When a page includes third party javascript (via script src=...) and that javascript that sets a cookie, that cookie "becomes" a first party cookie, even though it's originally set by a third party source. My question is this. If someone has disabled third party cookies in their browser, does that also apply cookies set by third party j...

Cover flow like jQuery plugins?

Anyone knows that any jQuery plugins or to build something similar to image effect/gallery like Apple OSX Finder - Cover Flow? ...

how to turn on and turn off "double right click" on google-maps-v3

how to do this thanks updated when you "double right click" ,the map will be zoom out so i want turn on zoom out or turn off it . and how to turn on and off "double left click" ??? thanks ...

can we catch the 'double right click' event on google-maps-v3 ??

can we ? i want to do something like this: google.maps.event.addListener(map, 'db_right_click', function(event) { alert('ssss') } how to catche the 'db_right_click' event ?? is there any way ?? ...

How to Adjust/Change Scrollbar Width

Is there a way to temporarily change the scrollbar width in FF or IE while I'm testing some layout code? I remember reading something a while back about this being related to resolution, but can't quite remember. I tried changing the resolution of the computer itself, tried increasing browser font size, but both didn't work. Update I'...

Need to replace everything after the second match

Ok so if I have this pattern: ab&bc&cd&de&ef And I need to replace all the ampersands except for the first one with commas so it ends up looking like this: ab&bc,cd,de,ef Its probably very simple but for the life of me I can't get this one figured out... ...

How to create and apply CSS to javascript Alert

Please help me.. tell me how to create and apply CSS to javascript Alert. i have got some other msgsbox also.. but as i have used alert every where so i just want to use CSS on it.. ...

get all elements under a mouse drag selection

Hi, You guys would have seen the image cropping tool which has a selection option (marque tool) created in javascript. http://marqueetool.net/examples/ Like this i want to get all elements under a selection. For example in windows we have mouse group selection of files and folders by dragging the mouse to select multiple files. Like th...

Call a javascript function after loading the Div

Hi, How to call the javascript function, after loading the particular div? Thanks in advance. ...

javascript date and loop check

Hey all, this is the code i have to check for a day thats equal to the list of days in the comma seperated list: for(var i = 0; i < daysHidden.length; i++){ if (daysHidden[i] == d.getDate()); { alert(daysHidden[i] + '=' + d.getDate()); } } the daysHidden = 1 (its the only thing in the list April 1st is already gone an...

question regarding execution sequence of function in javascript

hello friends my question is i am having two function f1 and f2 and if i want to execute function f2 after execution of f1 how is it possible? ...

regex. How can I match the value between '+' and ':' ?

I have this string: sometext +[value]:- I would like to match the value(1-3 numerical characters) (with regex, javascript) sometext may contain a +sign if i'm unlucky so I don't wanna end up with matching some +text +value:- I sat up last night banging my head against this, so I would be really glad if someone could help me. ...

Problem with Javascript RegExp-mask

I have a string that looks something like this: {theField} > YEAR (today, -3) || {theField} < YEAR (today, +3) I want it to be replaced into: {theField} > " + YEAR (today, -3) + " || {theField} < " + YEAR (today, +3) + " I have tried this: String.replace(/(.*)(YEAR|MONTH|WEEK|DAY+)(.*[)]+)/g, "$1 \" + $2 $3 + \"") But that giv...

How do I get the CSS of this element?

http://www.zurb.com/blog_uploads/0000/0617/buttons-03.html Is you go to this website. Scroll down to "Using the Button Element". Then the first black button called "Super Awesome button" What is the full CSS for this? Just one class. I want all the attributes of this. Is there any way to see it , just one class? In firebug it has a ...