Does anyone know the code fogbugz uses for styling their selects? I'm interested in getting some firefox functionality (when a fixed select width is set for the select, the options width show up expanded to fit long option values).
It looks like fogbugz is using a select still, but they've added in an input that shows the current val...
I have a complicated background image with a lot of small regions that need rollover illustration highlights, along with additional text display and associated links for each one. The final illustration stacks several static images with transparency using z-index, and the highlight rollover illustrations need to display in one of the in-...
I'm using prototype 1.6.0.1. I'm trying to select all the checkboxes when clicking a button. This code works in IE 6, but does NOT in Firefox 3. What am I doing wrong?
<input class="submit" type="button" value="check all" onclick="$(this.form).getInputs('checkbox').each(function (elem) {elem.checked = true;});" />
...
Given:
function foo(){
var bar = "quux";
console.log(/*mystery code here*/);
}
I'm looking for code that when inserted into the comment would yield the value of bar. By way of illustration, something like this works in a global scope:
var foo = "bar";
var bar = "quux";
console.log(window[foo]);
But, of course, variables defined...
Hello
I am creating a web app that uses Rails built in helper functions to add ajax functionality to the site. I do not want the user to be able to use the app without JS as it will not function properly.
I need to be able to prevent this. How can I go about stopping the user from loading any of my pages without JS?
I have tried to us...
I am dealing with a content editable div and I need to deal with capturing key strokes both before and after the character has been added to the div.
My understanding of capturing vs. bubbling is that the event gets captured at the highest level in the dom tree first then passes it down, while for bubbling it starts at the lowest level ...
Since I use jQuery 1.3+ all except one timed test is using that. The other is plain javascript I found from back in 2000. I stopped going that route as it was taking around 150 seconds to run the test. I've read quite a few jQuery optimization web pages that relate to selecting a single element. A '#id' is the best case for using tha...
I would like to know the easiest way to extract the text from a database field and set it as the default text for a text area.
I am planning at the moment to assiign the field to a variable, and then using javascript set it as the default text, but I am unsure of how to do this last part.
...
The Same Origin Policy Documentation says this:
There is one exception to the same
origin rule. A script can set the
value of document.domain to a suffix
of the current domain. If it does so,
the shorter domain is used for
subsequent origin checks. For example,
assume a script in the document at
http://store.company.com...
I have the following code:
$("#Table1 tbody").children().each(function(e){
$(this).bind('click',
function(){
// Do something here
},
false)
});
The Table1 html table has 2 columns; one for Names and one for a <button> element.
When I click on a table row, it works fine. When I...
For javascript prompt:
prompt("Message", "default value in the text field");
is it possible to add a variable into the default value?
For example:
var default = 'default value';
prompt("Message", +default+"and other values");
The above example doesn't work as it shows 'NaN and other values' in the text field. I want the field to ...
Does anyone use deferred execution of JavaScript or is it something from the past? (I don't see it used on major websites). Also, what are the pros and cons of placing your javascript in the head tag vs placing it in the body?
Thanks
...
Hi, Can you guys help me determine the performance difference of each of these
statements? Which one would you use?
Making a new Array using
- var new_list = new Array(); or
- var new_list = []
Appending element using
push('a')
new_list[i]; (if i know the length)
Ternary operator or if() {} else (){}
Trying to make isodd fun...
I'm developing an ASP.NET MVC application in which I want to encrypt a short string on the server, using C#, and send it to the client-side.
Then on the client-side it will be decrypted through Javascript code.
Any thoughts on how to implement this?
Do you know of a simple encryption algorithm (doesn't have to be bullet-proof secure) ...
I would like to include a flip counter on my site, similar to what Apple was using for their 1 billion app countdown.
Can anyone get their JavaScript to work standalone?
If anyone can provide working code, that would be great.
...
I'm writing a little jQuery extension that prevents a user from double clicking on a link.
$.fn.preventDoubleClick = function() {
return this.click(function() {
var $t = $(this)
, retVal = $t.data('active') // check the internal flag
;
if (retVal || retVal === undefined) { // if ON...
...
I've just been working on a jQuery extension described in this question, and have now run into another problem: I need to make sure that my particular event handler runs before any other event handlers which may already be on an element.
When adding events, it appears as though they get pushed to the back of a queue, whereas I really ne...
I am a C/C++ programmer with more than 10 years of experience. I also know python and perl, but I've never used this languages for a web development.
Now for some reasons I want to move into the web development realm and as part of that transition I have to learn css, javascript, (x)html etc.
So I need an advice for a good sources of ...
I need to automate some tasks on a website that does not have an API, and uses a substantial amount of JavaScript, without any graceful fall-back, so is it possible to parse over content added to a page via JS, with C#, I assumed that this would be done with a WebBrowser object but so far I've been unsuccessful.
...
What I'm trying to do is to create a table pager control using jQuery.
It contains lots of links and spans. I've managed to do this with plain string concatenation, but I can't believe that jQuery can't make this more elegant.
I can't use jTemplates here since the generation has quite a bit of procedural logic.
Question: is there a way ...