javascript

How do I get jQuery to apply an effect to each item in an .each() loop before it finishes?

I have the following list: <div id="test">test</div> <ul> <li>foo</li> <li>bar</li> <li>sta</li> <li>cko</li> </ul> and the following jQuery code: $(document).ready(function() { $('li').each(function(index) { $('#test').text($(this).text()); $('#test').show("drop", { direction: "down" }, 500, func...

Boolean object in javascript returns true for "false" parameter

Hello. I have a little problem. I have situations where my ajax calss returns a string. sometimes that string is "false" i want to always convert that string value into a boolean i tried : new Boolean(thatValue) but it returns true even for "false" as a paremter is there anyway to solve this? except me writing my own custom function ...

How to Find Img Tags Having src null. and deleting it

I need to delete or hide the Img tag or its parent when Img have src="". I have a script but it is not working.. window.onload=function(){ var imgs = document.getElementsByTagName("img"); for(var i = 0; i < imgs.length; i++) { var img = imgs[i]; if(img.src==""){ img.parentNode.removeChild(img); ...

Insert an image on mouseclick location

Hey guys, I need to insert an image wherever the user clicks on a specified element (another image), and for it to sit in front of that image. Can this be done in javascript? If not, with what? Thanks ...

Javascript: Comparing two float values

I have this JavaScript function: Contrl.prototype.EvaluateStatement = function(acVal, cfVal) { var cv = parseFloat(cfVal).toFixed(2); var av = parseFloat(acVal).toFixed(2); if( av < cv) // do some thing } When i compare float numbers av=7.00 and cv=12.00 the result of 7.00<12.00 is false! Any ideas why? ...

Adding a like button to a Facebook page using xFBML

Possible Duplicate: Adding Facebook Like button to fan page I have a Facebook page to advertise my company. I want to insert a button that looks like a Facebook "like" button using xFBML. How can I do that? ...

how to access a subdomain's html5 localStorage from the root domain?

When I have www.mydomain.com and mydomain.com, each of them gets a separate localStorage. I've read here http://msdn.microsoft.com/en-us/library/cc197062(VS.85).aspx that I can access www.mydomain.com's localStorage from mydomain.com root domain. But how do I do that? I've tried localstorage['www.mydomain.com'].getItem... but that does...

Why does one Javascript closure work and the other doesn't?

There are two versions, supposedly when the user click the first link, it will alert "1", and the second link, "2", etc: Version 1: <a href="#" id="link1">click me</a> <a href="#" id="link2">click me</a> <a href="#" id="link3">click me</a> <a href="#" id="link4">click me</a> <a href="#" id="link5">click me</a> <script type="text/javas...

How to call a function inside chrome/plug-in from html page?

Hi, I am developing one Firefox plug-in. In that, I am using sidebar and I am having an iFrame element within that with the source content from a HTML page. Now, I want to call a JavaScript function which is inside the 'chrome' (i.e. inside the plug-in) by an onClick() event on the HTML page, loaded in the sidebar. Is it possible? Ple...

When developing OOJS, should I reference the protoype function, or the variables version?

As the title (sort of) explains, when I'm prototyping in JS, and I need to reference another function of the object, should I access the protoypal version of it, or the local variables version? Is there any (major) overhead issues involved with either one? //starting off Foo = function(){ } Foo.prototype.ShowMessage = function(msg){ ...

jQuery autocomplete - clicking submit button does not count as "change".

Yeah, this is indeed my third or fourth question about jQuery UI Autocomplete. My latest annoyance is that clicking the 'submit' button in a form does not seem to count as a 'change' for jQuery. When my input box changes, jQuery runs some javascript to force a match against a list of acceptable inputs and their values: jQuery("#Resource...

GWT doesn't work in Internet Explorer 8

Hello Today I try to compile my first GWT project (using Eclipse). It has default 'en' location and also 'bg' location. I'm using ui.xml files with corresponding properties files. The only problem that I have is that project doesn't work in Internet Explorer 8. No problems with Firefox and Chrome. The start screen is ok, but when I upl...

Why can't I submit a dynamically created form in Firefox

I copied a part of a bigger project i'm working on, I didn't wrote the code so I hope someone could help me find out why sending a post request from js code with this fashion works in IE and doesn't in other browsers. function f() { var container = document.createElement("form"); container.method = "post"; container.action=...

Popping up a window for the user to show some data?

Hi, I have a webapp where my users might want to get some data from me in xml format. The flow I was thinking of: User clicks a button named "export" I generate a long xml string using javascript. Pop up a new window and just paste the xml string into it. I would prefer saving the xml string into a text file for the user, but I don'...

What is the correct syntax to refer to a gradient background color in javascript

Hello, I have a piece of javascript code like this right now. document.getElementById(pos).style.backgroundColor='#800080'; I want to refer to the following gradient background color instead of a staic value '#800080' in the code. .myBK {background: -moz-linear-gradient(top, #ccc, #000);} What is the correct syntax to do that? I...

How To Handle ASP .Net ReportViewer OnDrillthrough Event In Client JavaScript Rather Than Server Code Behind

Hi everyone, I'm trying to handle the OnDrillthrough event for the ASP .Net Report Viewer control using JavaScript rather than in C# code behind. I've tried lots of different methods so far including adding a attribute in code behind: mainReport.Attributes.Add("drillthrough", "mainReportDrillthrough()'"); Also tried using the $addHa...

sIFR 3 showing on my Home Pge but not on any other pages

I have integrated sIFR3 and it shows perfectly in my home page but not on any other pages. I never changed anything only the name of the font. Here is my sifr-config.js: sIFR.replace(helvetica, { selector: 'h3', wmode:"transparent", css: '.sIFR-root { color: #ffffff; font-size:18px; margin:0; padding:0;}' }); sIFR.replace(helvetic...

Jquery validation stopped working

Hi, here's my call to the validate function. Everything works fine with this code. $('#createForm').validate(function () { }); But when I try to modify it a bit, the whole validation stop working: $('#createForm').validate(function () { errorPlacement: function(error, element) { error.insertAfter(eleme...

A sticky situation for jQuery slideshow

I'm required to develop a slideshow (not an existing one) with jQuery. I was able to change picture with a function that I created named changePic (takes an image link). It incorporates the fading animation from the jQuery library. For the slideshow I'm trying to use a while loop. It kind of works, except that it doesn't wait for the a...

Take bounciness out of horizontal accordion

http://vincent-massaro.com/map/ Here is an example I am working on of a horizontal accordion linked with a Google map. The problem I am having is when you click on a slice on the right side, and then click another slice while the previous one is open, the first slice bounces in place. Any way to remove the bouncing going on? Thanks! ...