javascript

Google maps json geocoding, no response in browser

For whatever reason the following request gets no response from google. However if I paste the URL into the address bar it works fine. I'm not sure why this would happen. Is google filtering out requests by referrer headers? http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=3122%2C%20Australia $.ajax({ ...

.replace problem

I have a problem with html().replace: <script type="text/javascript"> jQuery(function() { jQuery(".post_meta_front").html(jQuery(".post_meta_front").html().replace(/\<p>Beschreibung:</p> /g, '<span></span>')); }); </script> what is wrong in my script? ...

Colorbox callback on gallery/ grouped photos/ slideshow?

Hi, I have a gallery setup to find the next span, this works, but the gallery navigation(next/previous/imageclick) is not passing the callback. $("a[ rel='gallery']").colorbox({ onLoad:function(){ $(this).next('span').show().prependTo($('#cboxContent')); $('span').addClass("current"); } }); I tried somet...

is unescaping a javascript pre-escaped function a bad idea for performance?

I want to pre-escape part of my javascript code and then include it in my page in the form of eval(unescape([code])). The reason is to hide something from spiders. would I be sacrificing performance? does any body have a better suggestion. Also found this obfuscator: http://javascriptobfuscator.com/default.aspx ...

Run JavaScript unit tests inside of Visual Studio 2010

I have been searching for a good way to run JavaScript unit tests inside of the Visual Studio 2010 IDE. I currently use TestDriven.net to run my C# units tests and it is very convenient to be able to quickly get the result of my tests in the output pane. I would love to find a similar experience for JavaScript (ideally working with Test...

fireContentLoadedEvent is being called prematurely in ie

I've got an issue that's only just started happening under ie8. my code has been working for some time, and still works fine in firefox but for some reason prototype just stopped calling my event listeners for dom:loaded. i attach them via document.observe("dom:loaded", callback); after some debugging (i hate ie's debugger!!!) i've com...

best practice or prior art for javascript scheduling calendar

This is a bit of a subjective question, and a red banner is warning me that it 'is likely to be closed', but I'm not sure of a better place to ask so here goes. My application calls for a very lightweight display-only scheduling calendar. Essentially an appointment book where you can see a few days or maybe a month at a time, and in ea...

JavaScript will not run a second time

I am running a script using $(document).ready() it is performing the way I want it to on load up, however, the same script needs to be ran when an html select control is changed. What I need ultimately is for the filter and sort to run on initial load with sorting on Low to High, and then after the page is loading the user should be abl...

javascript object System.Collections.Generic.List`1[System.String]?

In MVC, is it possible to pass an array of string (List<string>) from C# code to viewdata and then retrieve the value in the view? e.g: C#: List<string> names = new List<string>(); names.Add("a"); names.Add("b"); ViewData["names"] = names; MVC view: <script type="text/javascript"> var nameList = '<%= ViewData["names"] %>'; </script>...

Jquery and radio buttons

So I have some custom radio buttons which I created using js and some css, now I want when I click on a custom radio button, to set the clicked radio button as checked and the order ones as unchecked, so it should be only one checed radio button at the time.Here is what i tried to do, but doesn't work. $('.custom-checkbox li span, ....

Regular Expression to validate short and long date in mm/dd/yyyy format in javascript

Hi all, I wanna validate date which can be either in short date format or long date format. eg: for some of the valid date. 12/05/2010 , 12/05/10 , 12-05-10, 12-05-2010 var reLong = /\b\d{1,2}[\/-]\d{1,2}[\/-]\d{4}\b/; var reShort = /\b\d{1,2}[\/-]\d{1,2}[\/-]\d{2}\b/; var valid = (reLong.test(entry)) || (reShort.test(entry)); if(valid...

Trigger Google Maps from Android browser

I have a website designed for the android browser using jquery/jqtouch. As a part of it, i have a map page that loads. In the process of displaying my data, I found that some of my customer's addresses, when clicked kick of the google app map, with the data sent to it. It also seems to load and run a ton faster (as well as having all ...

Google maps - pass information into an event Listener

I think this is a scope problem. Since the event is triggered after I have added all the listeners num_markers has always been overridden by the next cycle in the loop. Is there some way I can pass variables to the event function? I tried this approach but it didn't for me. http://stackoverflow.com/questions/1841247/google-maps-event-l...

What is wrong with my date regex?

var dateRegex = /\/Date\((\d+)\)\//g; // [0-9] instead of \d does not help. dateRegex.test("/Date(1286443710000)/"); // true dateRegex.test("/Date(1286445750000)/"); // false Both Chrome and Firefox JavaScript consoles confirm. What the hell, guys? Edit: even simpler test case: var dateRegex = /Date\(([0-9]+)\)/g; dateRegex.test("...

Javascript - work with popup

I have to open a new window window.open(); But in IE, it will detects a popup and block, if I allow then the window is opened. How can I bypass this popup blocker and open it directly? ...

Detect iPhone Browser

is there a script to detect, if the visitor use iphone (whatever it's browser, may iphone Safari, iPhone for Opera or etc.)? Then will shutdown some some of my JavaScript. Thanks... ...

ASP.NET MVC 2 Confused about Javascript

Hi I'm building my first MVC 2 app and I'm really confused by all the examples I'm reading. I am also using the Telerik MVC kit for their Grid, and other such controls. I've read many tutorials and watched videos but I can't quite grasp the pattern of where to place javascript and how to wrap blocks of code in the appropriate tags. For ...

Get the reference name of an object?

I have an object inside another object: function TextInput() { this.east = ""; this.west = ""; } TextInput.prototype.eastConnect = function(object) { this.east = object; object.west = this; } textInput1 = new TextInput(); textInput2 = new TextInput(); textInput1.eastConnect(textInput2); puts(textInput1.east.name) // ...

ajax img change

i have implemented a code that fetch single image from 1000+ images. The image has been changed using ajax call and downloading time of each image varies. How to make this image change with smooth transition from one another i.e without any flicker and ajax processing image ...

how can i trigger event when hidden div get focus in jQuery?

In a tabb design If there are multiple hidden div how can i trigger event when hidden div get focus using jquery. I tried "focus" but thats for form controls. please suggest ...