javascript

Iteration order of for..in loops in Javascript

Suppose I have a Javascript object which is initialized var letters = {q:0, t:0, o:0, b:0, y:0, n:0, u:0, m:0, p:0, w:0, a:0, d:0, k:0, v:0, c:0, z:0, l:0, j:0, i:0, e:0, g:0, s:0, x:0, r:0, h:0, f:0}; and then I want to iterate over the keys of this objects for(var letter in letters) { // code goe...

How to Customize Hyperlinks on Client Side in ASP.NET MVC

I need to be able to do two things with Javascript or JQuery, without involving third-party open source libraries: Use a jQuery or Javascript function to fill the HREF attribute of a link. Perform an HTTP Get or Post operation OnUpdate of a text box or combo box (using the above javascript function to specify the HTTP target) The end...

Duplicate variables in JavaScript

Is there is any way/tool to detect the duplicated variables/methods names in the project JavaScript files? ...

Anyone know a mousehover trick/alternative which triggers when scrolling with keyboard

Is there an alternative method or a trick to the hover method which can trigger a function when the cursor moves from one div to another as the user scrolls the page. I have sort of got it working using some javascript (jQuery) on the hover event of the current post div. However, I've noticed the hover event only triggers when the mouse...

How can i check if a JavaScript-Eventhandler has been set?

Hallo, i've got a JavaScript-function that sets the "onclick"-event of some HTML-Nodes - even if that "onclick"-event has been set before. How can i check if that event has already been set, so i can extend my function to set the event only on HTML-Nodes where it has not already been set ? ...

How can we make the DataView Control respond to javascript events?

If I had an ASP.NET 4.0 DataView control that looked like below, how can I control javaScript events on the client side? Body tag: <body xmlns:sys="javascript:Sys" xmlns:dataview="javascript:Sys.UI.DataView" sys:activate="*"> DataView tag: <ul sys:attach="dataview" dataview:data="{{ ListOfPeople }}" class="sys-template"> ...

Javascript confusion

var allRapidSpells = $$('input[value^=RSW]'); Can anyone tell me what that does? ...

jQuery click brings me to top of page. But I want to stay where I am

I have a simple click and show, click and hide button, but when I click it, the page anchors at the top of the page. Is there anyway to prevent this? So that when I click the button, I stay at the same place in the browser? My code is.. $('#reportThis').hide(); $('#flagThis').click(function () { $('#reportThis').show("slow"); }); $('...

Using JavaScript, is it possible to detect when an embedded Flash object has stopped streaming audio/video?

Hi. this is my first post here. I'm using an existing Flash widget but would like to add more functionality to. The Flash widget is a basic audio player with limited functionality. As I don't have any control over how the widget was built, I'm unable to directly communicate with it but I'd like to detect when it's stopped streaming so ...

Can a non-embedded resource js file access resource file (.resx)?

I have used the embedded resource js file to reference the .resx file before. (by including something like [assembly: ScriptResource("Applications.Webs.Scripts.HelpModule.js", "Applications.Webs.Scripts.Resources.HelpResources", "Resource.HelpResources")] in the code behind of the page, where HelpModule.js is a embedded resource) ...

Clean global search and replace using JavaScript ?

I am coding a little bookmarket to convert all the devises in the current page to another. I heavily relies on regexp, and I use Jquery to easy the work. For now, I do that like a big fat pig, replacing all the body : $("body").children().each(function(){ var $this = $(this); var h = $.html().replace(/eyes_hurting_regexp/g, "my...

Validating Dates in Javascript with Unusual Form Field Ids - Salesforce.com Web-To-Case Integration

Ok, I need help. This is my first question here. Background: I am working on a charity project, and my portion of the project is to build the Web-To-Case functionality with Salesforce.com. Salesforce.com, if you were unaware, gives its software away free to qualified non-profits. Anyway, the Web-To-Case feature in Salesforce.com ge...

How to load a Google Static Maps Image using Javascript

Right now I can use this URL to request a Google Static Maps image successfully: http://maps.google.com/staticmap?center=37.687,-122.407&amp;zoom=8&amp;size=450x300&amp;maptype=terrain&amp;key=[my key here]&sensor=false However, the second I use JQuery or any direct javascript to set an image's src to the above url, Google passes back...

How can I provide a limited interface to Greasemonkey's GM_xmlhttpRequest to my page's Javascript?

I have a Greasemonkey userscript which runs most of its code in an unprivileged context by inserting a <script> tag like so: function code { ... } var script = document.createElement("script"); script.type = "application/javascript"; script.innerHTML = "(" + code + ")();"; document.body.appendChild(script); This avoids the need to ...

Jquery ajaxForm beforeSubmit fires on document.ready

Hi, i have the following code: $("#forma_mod_uid").livequery( function (){ $("#forma_mod_uid").ajaxForm({ beforeSubmit: mcargando("#cargando2"), target:'#mod_2', success: ocargando("#cargando2") }) }); the mcargando passes the div wich will contain a spinner img, and then o...

How to execute javascript inside a script tag returned by an ajax response

I'm sending a jquery get request like so: $.get($(this).attr("href"), $(this).serialize(), null, "script"); The response I expect to receive will be wrapped in script tags. I understand the browser doesn't execute the response unless its returned without the script tags. Normally I would remove the tags from the response but in this ...

Javascript problem accessing form name value

I want to access the 'name' value of a form I have by using document.write(document.getElementById('listing').name); This doesn't output anything which I found odd. What is even more odd is the following. It will only bring back "NordstromListing" when I get rid of everything underneath box4. I have absolutely no clue to why that ...

Best Practices for IntelliSense JavaScript references

Assuming a person has Visual Studio 2008 set up correctly for JavaScript Intellisense, what are the best practices for the actual javascript reference declarations? The basic form, of course, is (right up at the top of the file): ///<reference path="path-to-file.js" /> But what are the rules for the path? Webapps Should web applica...

Are There Memory Issues with Ext.js

The UI for an application I work on was recently redone with Ext.js and I have noticed the memory usage of IE seems very large when viewing it. Are there known memory issues with Ext.js when using IE? ...

How can I fire functions once an image has been loaded using jQuery?

I am writing a simple image replacement script on a site I am working on and having a bit of trouble. The code I have at the moment consists of: $(function() { // When a thumbnail is clicked $(".zoom_thumbs a").click(function() { // Get large image attributes var largeImg = $(this).attr("href"); var largeTitle = $(thi...