javascript

IE not allowing onClick event on dynamically created DOM 'a' element

I'm having issues with internet Explorer. I have a link which duplicates a file upload element on a form. The code which duplicates also appends a hyperlink to the duplicated upload element which is supposed to remove the duplicated element a simple remove this link. The issue is that this code runs fine in firefox but it doesn't run at...

ASP.NET MVC Sharing JavaScript files from Class Library

Hi, I am building two ASP.NET MVC sites. There is a certain amount of content I wish to be able to share between the two sites. I created a class library and was able to share a large portion of what I needed too. However I would really like to know how I could share contents such as images and javascript files, so I do not have to d...

How do you get the co-ordinates of en element from browser window top and left in javascript?

I need to get the element co-ordinates relative to browser window. How do you get that in javascript ? ...

Stopping form submit during onlick of an input type="image"

The reset action is performed by input type="image" and onclick calls a function called resetForm(). When reset is clicked the form submit shouldnt happen.Tried returnin false from resetForm() function and still it doesnt work. Please help me out.. ...

Spring MVC JavaScript

In a Spring MVC app, what is the best approach for putting external JavaScript files in WEB-INF/ along with jsps? /WEB-INF/spring/foo.jsp which has an include of <script src="foo.js"></script>. I want foo.js in the WEB-INF/spring/ directory right beside the owning jsp? I've noticed Spring has a ResourceSerlvet, but I'm not sure i...

better quality thumbnails from larger image files

I'm showing images from other websites as thumbnails. To do this I display them in a smaller img tag so the browser does the size decrease. The problem is that the quality of these images (which I have no control of) is diminished. Also they look much better in FF and Safari than in IE. Is there a way to make these images look better w...

JS: Is there a way to tell what object called a function?

In a function is there a way to get a reference to the object that called it? I have the same instance of a Flash object on the page twice, each one can make calls to JS through ExternalInterface, I cannot code the Flash objects to each pass a different ID because it is 2 instances of the same Flash object, so it there a way for JS to ge...

get value of hidden field

Hi, I reference the hidden field like: var h = document.getElementById('myHiddenField'); How can I set the value to 100, and then output the value using a simple alert();? ...

How to get a reference to a JavaScript function object from its name as a string?

In JavaScript, if I have a string in a variable, is there a way to get a reference to the function object which has that matching name? Note that jQuery is available to me so I can use any of its helper methods also. For example: myFunction = function(){}; var func_name = "myFunction"; var myFunctionPtr = ??? //how to get the functio...

Please recommend a JQuery plugin that handles collision detection for draggable elements.

We're using the Draggable JQuery UI plugin and need to disallow overlapping among our elements. We could write some collision detection ourselves but would prefer to use a tested package. Any suggestions? ...

Stop browser from jumping to #name when page loads

I have a form in a jQuery dialog box named "login". In JavaScript, I detect if "#login" is in the URL -- if so, it displays the login dialog box. In FF/Safari/Chrome it works fine, but in IE6/7 the browser page jumps down to the top of the form when the dialog box is displayed. I would like to prevent this from happening. I found what l...

jQuery .getJSON function needs to rebind returned data.

I am having trouble getting my modal window function to bind to some returned data. I am using Cody Lindy's Jquery.DomWindow plugin. Please note that everything functions properly, except for this problem. The problem occurs when the data that is returned from my jQuery.getJSON call contains a link that is supposed to open up the modal ...

jQuery Plugin development help

Hello jQuery Gurus, This is my first attempt at a plugin but I think I'm missing the whole "How to" on this. Ok here goes: Trying to write an error popup box for form validation. I like the look and functionality on this JavaScript code on this page, See demo here and source here. It's basically what I want to do if the user enters ...

Links on top of elements with onclick-handlers

Hey. I've got a dumb, but nasty problem. If I've got this (simplified) situation: <div onclick="doSomething(); return false;"> lorem ipsum <a href="somewhere.html">dolor sit</a> amet </div> ...is there any (convenient) way to prevent the onclick-handler of the parent div from being triggered when the link is clicked. In my scena...

How send parameters with javascript tag?

How can I send parameters (with QueryString) within a javascript tag as the source attribute to a ASP.NET page? Example: <script language="javascript" src="myDomain/myPage.aspx?id=123&no=43"></script> And what I have to do in "myPage.aspx"? For example I want to send a picture to the script tag according to it's src querystring. ...

How to create autosuggest to get keywords as fast as google search or live search

I am creating auto suggest function in my website search box, every time the user press a new key, javascript call a webservice on the server side to get 10 most relevant keywords from the db and gives to the javascript again, and javascript populate the search autosuggest list. My function is not too slow, but comparing to what live.com...

Keep an Animated GIF Going After Form Submits

The following works for me in ie6,ie7,chrome but not ff3 document.getElementById("form-name").submit(); var image = document.getElementById("loader-img"); setTimeout(function() { image.src = image.src; },50); What can I do for more consistency? ...

Compatible Encryption Libraries between client a server side (Javascript -> C# or Java)

Sometimes HTTPS is not enough. Specially when we are talking about protecting user data from troyans with access at winsock32 level where they can sniff https in plain text or BHOs objects that already have access to the decrypted posted data in the browser memory. In this scenario, I have developed a javascript -> classic asp client se...

dynamic script loading synchronization

I have a script that knows to load dynamiclly scripts that contains javascript classes. i'm loading the class script using the following code: var head = document.getElementsByTagName("head")[0]; var script = document.createElement("script"); script.type = "text/javascript"; script.src = "myscript.js"; head.appendChild(script); i'm th...

jquery toggle effect resetting element width

For some reason when i use the jquery toggle function with a speed option, the element width is animated at the same time (from 50% of the width to its full extent). I don't recall noticing it in previous version of jquery. Is there a way to make sure the toggle doesn't touch the width? The problem is that i have some floated content in ...