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...
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 ...
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);
...
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
...
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?
...
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?
...
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...
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...
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...
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){
...
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...
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...
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=...
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'...
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...
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...
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...
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...
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...
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!
...