javascript

Is there any gmap’s api function to concatenate address string from AddressDetails structure?

Hello! I’am using Google Map’s GClientGeocoder for reversing map coordinates into string address. Exactly as shown in google’s example here http://code.google.com/apis/ajax/playground/?exp=maps#geocoding_reverse But, I would like to remove LocalityName (place.AddressDetails.Country.AdministrativeArea.Locality.LocalityName) from place.ad...

Add the "selected" attribute to a drop down option with jQuery

How do I add the attribute "selected" to a drop down menu option based on that option matching some variable? Here is how the dropdown is populated... loginOptions = ["First", "Second", "Third"]; var Login = $( '#Login' ); for ( var i = 0; i < loginOptions.length; i++ ) { Login.append('<option value="'+ log...

How do I insert text at the focus into a markitup editor with javascript?

I've implemented markitup to handle users entering markdown text. I want to replace the default image insert command with a nice jquery routine that lets the user browse for an image. I'm able to edit the set.js file to call my javascript routine that brings up the file browser: {name: 'Picture', key: 'P', call: 'insertImage'}, My ins...

Is there a Javascript cron implementation somewhere that I'm missing?

I'm aware of timing issues in Javascript, how its not exact/off by milliseconds etc, but I need something to at least attempt to do browser-based scheduling. In terms of features, I'm thinking something along the lines of scheduling patterns described here: http://www.sauronsoftware.it/projects/cron4j/manual.php#p02 Anything out there?...

How can you make a variable/Object read only in Javascript?

Possible Duplicate: Can Read-Only Properties be Implemented in Pure JavaScript? I have an Object that I only want to be defined when constructed. How can I prevent the Object reference from being changed? ...

How to check if XMLHttpRequest's send() supports File

Safari's XMLHttpRequest's send() method supports a File argument. Firefox does not (yet). How can I check if this is supported? In Firefox, it will just behave as if an empty string was passed. I'm trying to avoid doing browser version detection. Edit: FF 3.6 does seem to support it, but the question is still relevant for older versio...

triggering onchange event

Hello All, I'm not able to get the below code to work. $("#grid_table td:nth-child(10) input").live("onchange",function () { alert("changed"); }); am I missing something here? Thanks. Ravi ...

How to make $(document).ready() functions available globally?

Hello everyone, I have an interesting question here that may sound pretty silly, but here goes. Using JQuery's ready function I have defined some functions like so: $(function(){ var function1 = function(data){ //do something } var function2 = function(data){ //do something else } }); For some reason, in order for ...

Weird black spots on custom Google Map with IE

Hello. I'm getting some weird black spots with a custom map page (via the Google Maps API v2.x) I have created. (Click SERVICIOS and then the icon farthest south to generate image shown below.) The issue seems to only appear when using Internet Explorer. I'm wondering if this is a common problem and if there is a common fix? Any ideas? ...

iFrame src change event detection?

Assuming I have no control over the content in the iframe, is there any way that I can detect a src change in it via the parent page? Some sort of onload maybe? My last resort is to do a 1 second interval test if the iframe src is the same as it was before, but doing this hacky solution would suck. I'm using the jQuery library if it he...

100.toString vs 100['toString']

100['toString'] //does not fail 100.toString //fails why? 100.toString is not same as 100.toString() . So why in the second case I am not getting the function as returned value? ...

Attaching methods to prototype from within constructor function

Here is the textbook standard way of describing a 'class' or constructor function in JavaScript, straight from the Definitive Guide to JavaScript: function Rectangle(w,h) { this.width = w; this.height = h; } Rectangle.prototype.area = function() { return this.width * this.height; }; I don't like the dangling prototype man...

Javascript Regular Expression "Single Space Character"

Hello experts, O am learning javascript as I analyze existing codes. In my JS reference book, is searching an single space be "\s"? But I have came across a code obj.match(/Kobe Bryant/); Instead of using \s, it uses the actual space? Doesn't this suppose to generate an error? ...

Windows Sidebar gadget - cannont access a div in Flyout DOM

In the main gadget html, there is a div with an onclick that calls this method in the Gadget script file: ShowFlyout = function() { System.Gadget.Flyout.show = true; var flyoutDoc = System.Gadget.Flyout.document; var mainFlyoutDiv = flyoutDoc.getElementById('divFlyout'); mainFlyoutDiv.innerHTML = "hello"; } Here is th...

Script files returning 404 Error.

Hi, I'm using ASP.Net and whenever I create a script file or try to include a script file like jQuery they aren't working. I am doing just a regular localhost server and none of the scripts are working. Upon further examination using firebug I look at whats being referenced in those scripts and it shows html code for a 404 error. I know ...

invalid argument IE7 javascript line number changes

This is the test page: http://www.onebagoneearth.com/ OBOEKindBag (spaces between the page name and domain because I don't want the URL indexed as such) If you click on one of the thumbnails, or on the main image, you see a popup window, and if you enter a quantity and then click "add to cart" here, in IE7 (at least on Vista, and als...

Using jsAnim.js

I've been trying to set up a basic test animation using jsanim.js and using their example site to set up my html, css and js. However, I just can't figure it out (not a developer...designer!) and there isn't just a simple html, css, js file to download showing how to say animate a DIV left to right. The examples of how the library works...

Does anyone know of a good free bulk upload tool for web apps?

I have a web application in which a user has to upload images to a gallery. At the moment they need to upload one image at a time so it's pretty tedious. I'd like to implement a system where they could potentially drag and drop files into the browser, or select a folder to upload. Any ideas? Thanks in advance! (By the way; it's a .Ne...

How to send "multiple" extra parameters on a link/button_to_remote call?

In this example, <%=button_to_remote "Get Related Users", {:url => { :action => 'get_related_users' }, :update => 'result',:with=>"'someVal=3'"} %> If I have to send one more key/value pair [someVal2=5], what will the :with look like? ...

Using removeEventListener on document does not work?

Hi, take a look at this code: $(document).ready(function() { document.getElementById(sliderId).onmousedown = sliderMouseDown; }); function sliderMouseDown() { document.onmousemove = sliderMouseMove; document.onmouseup = sliderMouseUp; } function sliderMouseMove() { $('#test').html("sliding"); } function sliderMouse...