javascript

How I can add and remove the attribute "readonly" ?

$(document).ready(function() { //Check City Value var city_value = parseInt($("#city").val()); if( city_value == 0) { $("#state").attr("readonly", true); //$("#rate").attr("readonly", "readonly"); } else { $("#state").removeAttr("readonly"); //document.getElementById("state").removeAttribute("readonly",0); ...

Replacing content with jquery.

I am loading a movie into a overlay. My problem is that when I close the div overlay the movie continues to play. I do not control the code on the move side it is imported via a script tag which then opens in a iframe. I am able to remove the content of the of the div and then the movie stops playing. Then of course when the user opens t...

Google Wonder Wheel API or js widget

Hi, do you know a Google API or a jquery js plugin to visualize the data like "Wonder Wheel"? I'd like to use this widget with my data. http://bit.ly/dysDQn ...

How do I verifying if site has javascript enabled and if user's browser is IE 8

How do I verify if a site has Javascript enabled and if user's browser is IE 8? ...

Stack Overflow-like tag selector for Rails

I want to use tags for a model in my Rails application, and I'd like to have the same kind of tag selection mechanism that Stack Overflow has when asking a question. I.e. I type in 'rails' and it drops down a list of tags that include 'rails', and I can go on to add more tags from there. Is there a plugin that can do this? I'm comfortab...

jquery, changing form action

i cannot seem to find the answer to this. i uploaded code to pastebin (so wouldnt clutter up the post): http://pastebin.com/BhnNTnJM but the action only changes for the delete form (id=form-horse-delete) and not the other 2 forms located on the page. i am at my wits end trying to figure out why it doesn't work for the 2 forms, yet wil...

NodeJS: Write to file

I've been trying to find a way to write to file when using NodeJS, but no success. Can you help me with this. Thanks. ...

Javascript to encode cookie contents into a get or post?

I want to pass cookie contents from one domain to another. I don't want to get involved with actual cross-domain cookies. I was thinking of reading the cookie on the domain that sets it and then sending it as an encrypted JSON object to the domain that wants to use it. Is there an accepted way of doing this and/or a toolkit that han...

Problem with jquery fade images and menu drop down

Hi Mates I have a problem with internet explorer 6 and 7, please look this example http://www.aerocom.net.au/index.php?id=hosted-services I lost the submenus when i pass over them just in ie7 and ie6 please i need you help. Cheers ...

Javascript - Jquery .load() and setInterval() issue.

Let's say I do this: $("#content").load(...); Within what I'm loading some javascript is included: var myCounter = 0; var myInterval = setInterval(function(){ myCounter++; $("#counter-display").html("Count: "+myCounter); }); For an unknown reason, if I reload the content with $("#content").load(...); - myInterval is now bein...

How do you optimize stunicholls' "Professional dropdown #2" with jquery?

Link to menu: Professional dropdown #2 I was wondering if these posts Suckerfish meets jQuery or Son of Suckerfish dropdowns in jQuery could optimize the menu above. I need the menu to be optimized for IE6, because when I use the menu as it is, the menu hangs after I click on a menu item that loads a page with heavy processing. It tak...

How to Load Bing Map using Coordinates from Database?

I have latitude and longitude saved inside a database. I have the bing map loading and I can set the VELatLong using regular values but can't seem to be able to load them from the database. Whatever I try the map just doesn't show at all. <script type="text/javascript"> var map = null; var selStyle = VEMapStyle.Road; var sel...

How to let css selector exclude an element ?

For example I have a css style like this : input.validation-passed {border: 1px solid #00CC00; color : #000;} The javascript validation framework I use will inject every input tag with a class="validation-passed" .For the elements like <input type='text' /> ... , this is ok , but for <input type='button' /> , I want this is not ap...

how to listen for changes to the title element?

In javascript, is there a technique to listen for changes to the title element? ...

how can I declare a value deep in an object tree using variable properties in javascript

I am trying to have a javascript object tree behave like a php associative array in the following way. var key1 = 'a'; var key2 = 'b'; var key3 = 'c'; var obj[key1][key2][key3] = 'd'; However, in javascript I believe you need to define each property/object pair individually, forming deeper leaves. Something like: var obj[key1] = {};...

Is it possible to resize text to fit a fixed size div?

This seems like a pretty natural use case to me, though I haven't been able to find anything on it: Say I have a fixed-width div that is dynamically populated with some number. What's the best way to ensure that numbers with more digits take smaller font sizes such that they fit nicely into that fixed width? Is there some CSS property f...

Height of a html window's content (not just the viewport height)

Hi All, I'm trying to get the height of a html window's content. This is the full height of the content not the visible height. I have had some (very limited) success using: document.getElementsByTagName('html')[0].offsetHeight in FireFox. This however fails in IEs and it fails in Chrome when using absolute positioned elements (http:...

Continuous Progress Bar in Javascript

Hello, I am trying to find the best option to create a simple progress bar that I need to be triggered periodically from within another JavaScript script. Every few minutes, a timer would cause the progress bar to start going from 0 to 100%. Once it reaches 100%, the bar would reset to 0. I am trying to implement a smooth animated ve...

HTML/CSS: How does Google create this drop shadow over their maps?

Question: How does Google create the dropshadow next to the vertical scrollbar over the Google Map? Linked below is a screenshot depicting exactly what I'm talking about. http://img291.imageshack.us/img291/2214/googlemaps.png This seems to be regardless of browser (IE, Firefox, Chrome) and platform (Windows, Mac, Linux). ...

onmouseover with django / imagekit

I'm using Imagekit. View.py includes: def pics(request): p = Photo.objects.all() return render_to_response('Shots.html', {'p': p}) The following simple code in the template will generate associated images: {% for p in p %} <img src = "{{ p.display.url }}"> <img src = "{{ p.thumbnail_image.url }}"> {% endfo...