var Test = (function() {
return {
useSub: function () {
this.Sub.sayHi();
},
init: function () {
$(document).ready(this.useSub);
}
};
})();
Test.Sub = (function () {
return {
sayHi: function () {
alert('hi');
}
};
})();
Test.useSub(); /...
Hi all - I know how to gray out the weekends on the jQuery Datepicker by instantiating it like this:
$('.calendar').datepicker({ beforeShowDay: $.datepicker.noWeekends });
The Datepicker also automatically selects the current date, so if the current date happens to be on a weekend, nothing is selected.
How can I make it select the nex...
I am populating a dropdown from a jquery ajax call to a web service that is returning json data. If for some reason the webservice fails or is unavailable how do I handle this? I don't want to have my users looking at an empty dropdown.
How can I cache the last successful call and use that instead?
...
It goes almost without saying, this works perfectly in Chrome, Firefox, and Safari. IE (any version) being the problem.
Objective: I am trying to load JWplayer which loads an FLV from S3 in a Facebox popup.
jQuery(document).ready(function($) {
$('a[rel*=facebox]').facebox()
})
HTML (haml):
%li#videoGirl
= link_to 'What is HQcha...
I have a function acting as a constructor that, when called, gets as far as the function definition in the debugger, but never to the function body. Is there a common reason this may happen that I am overlooking? Example code below:
myconstructor.js
function MyConstructor(optionalParam) { //this breakpoint gets hit
var newobj = {...
I have an array, like
var acronyms = {
'NAS': 'Nunc ac sagittis',
'MTCP': 'Morbi tempor congue porta'
};
I need to find first match of each acronym and wrap around with tag via jQuery.
E.g.
<div id="wrap">NAS dui pellentesque pretium augue. MTCP pellentesque pretium augue. NAS ac ornare lectus MTCP nec.</div>
becomes
<di...
I want to generate tooltip based on a dynamically changing background image in css.
This is my my_css.php file.
<?php
header('content-type: text/css');
$i = $_GET['index'];
if($i == 0)
$bg_image_path = "../bg_red.jpg";
elseif ($i == 1)
$bg_image_path = "../bg_yellow.jpg";
elseif ($i == 2)
...
When I create a document using javascript document.write
this is an iframe
then i call iframe.print()
nothing happens no error and no print dialog.
how can I print?
MyFrame.document.write('<html><body>'+HTMLText + '</body></html>');
document.getElementById("IFramePrint").style.display = "inline";
MyFrame.focus();
MyFrame.print();
...
Hi there,
I'm trying to modify CouchDB's JS API to work asynchronous, but there is an error I cannot solve:
Please find my JS API find at pastebin.
If I call (new CouchDB("dbname")).allDocs(function(result) {console.log(result)}) (line 193) I get an error because the okCallback function is not defined in the callback function.
I don't...
I'd like to pass an associative array (or simply an object with property names & values) to my ActiveXObject. I can't find anyone who has successfully and simply passed complex data from javascript to an ActiveX object.
My ActiveX object is being loaded in IE, and it's mine so I can change the method signature & code to whatever will w...
Question:
There seem to be many benefits to Closures, but what are the negatives? Additionally, is my understanding of Closures correct? Finally, once closures are created, can they be destroyed?
I've been reading a little bit about Javascript Closures. I hope someone a little more knowledgeable will guide my assertions, correcting me...
Hello all,
I am trying to make use of a script that uses CPAINT and I keep getting the error above when I click on favourite an item (a 5 star rating system).
It looks like it is making an AJAX request but I can not see this from my Firebug to debug this - why is this the case?
More importantly what does the error code 0 mean?
Thank ...
Hi,
I'm currently writing a SilverLight application that primarily uses a DataGrid.
The user can add or remove rows from the grid.
The grid can get quite large so I need to resize the application dynamically every time a row is added/removed.
Currenty I'm doing the following to resize the app dyamically.
In the codebehind I'm using t...
Example (load in IE6): http://jsbin.com/uheco/14
In IE6, if the user clicks on a SELECT and does not click any OPTION but instead clicks somewhere else on the page outside the SELECT, the SELECT still has focus.
I expected the SELECT to lose focus when I clicked once outside of it (such as in IEs 7 & 8).
Functions bound to the blur ...
I'd like to build a website that aggregates and displays content from hundreds of RSS feeds. The feeds will be from different sites: Twitter, Flickr, Tumblr, etc, so the content will be very heterogenous.
In a perfect world — and this is more of a side issue — I would like to allow other people to help manage the list of feeds and assi...
I came up with a good solution for a client showing a google map iFrame using the normal google maps embed. Only problem? They want the links inside the iFrame to open in a new window instead of there on the page.
So, I used the static API to come up with a static image of a map and have that link to the google maps site with target="...
I need to display an image in a resizable dialog (so far all the specific image popup libraries I have tried do not fit my needs).
All I want to do is maintain the aspect ratio during resizing. Sounds easy, but it's not.
I thought something like this might work, but no dice:
var d = $("").dialog({title:title, width:400, height:400});
...
Here's the sample code:
var d = new Date("2010-06-09T19:20:30+01:00");
document.write(d);
On FF3.6 this will give you:
Wed Jun 09 2010 14:20:30 GMT-0400 (EST)
Other browers tested; Chrome 5, Safari 4, IE7 give:
Invalid Date
I know there is limited to no support for ISO8601 dates, but does anyone know what and/or where the differ...
I have a ad banner that has a form and this is used by 3rd party site owners that grab this code and have this banner on there site.
Since some sites that use this banner have a <form> wrapping there entire site i have found that the banners form doesn't submit it rather submits the outer form.
Here is the code:
<form onSubmit="retu...
I am using php conditions and want to know if I can run a JavaScript funtion without some one have to click on it using JavaScript:
if($value == 1)
{
javascript to run the function
}
How would I do that?
...