Hi friends,
I want to select an option in select tag through the value. - javascript
var selectbox=document.getElementById("Lstrtemplate");
var TemplateName=selectbox.options[selectbox.selectedIndex].text;
Now i am having the option text in TemplateName, using this i want to update an another select tag, which is having the same tex...
I was looking through Mozilla's JS in JS code and came across the snarf function. It's not defined in the javascript, it seems, just in the C version here. It isn't very well-commented, though. I Google searched this to no avail.
Is this a standard part of JavaScript? (My guess is no.) Is it some kind of extension? What is it supposed ...
I'm needing to add functionality similar to Gmail where the checkboxes on a list of items is remembered across multiple pages of results and when going away and coming back to the result. What I'm trying to figure out is the best way of doing this. I'm using PHP and likely jQuery.
My first thought is to add an onClick to each checkbox t...
Let's say I have download links for files on my site. When clicked these links send an ajax request to the server which returns the URL with the location of the file. What I want to do is direct the browser to download the file when the response gets back. Is there a portable way to do this?
...
Namely, how does the following code:
var sup = new Array(5);
sup[0] = 'z3ero';
sup[1] = 'o3ne';
sup[4] = 'f3our';
document.write(sup.length + "<br />");
output '5' for the length, when all you've done is set various elements?
EDIT: Forget the comparison to using it like a hashmap. I think this was confusing the issue.
My 'problem' ...
Is there any way to create an array-like object in JavaScript, without using the built-in array? I'm specifically concerned with behavior like this:
var sup = new Array(5);
//sup.length here is 0
sup[0] = 'z3ero';
//sup.length here is 1
sup[1] = 'o3ne';
//sup.length here is 2
sup[4] = 'f3our';
//sup.length here is 5
The partic...
Looking at the mozilla documentation, looking at the regular expression example (headed "Creating an array using the result of a match"), we have statements like:
input: A read-only property that reflects the original string against which the regular expression was matched.
index: A read-only property that is the zero-based inde...
I'm trying to write a greasemonkey script, and it would be preferable for it to be able to work with images (specifically, find the darkest pixel in an image). Is there a way to do this or must I embed flash?
...
MSIE v7 does not (in my hands) open a Modeless Dialog or trigger an onLoad event if there is a Javascript alert in the target page. The following fails in MSIE v7 but is OK in v6 (zip file of full source available if required).
Would appreciate others confirming this and discussing why this should be so.
index.htm (only javascript fun...
I need to know how I can search an array for some literal text and have it used as a condition whether to continue.
Heres why:
Each time I execute a function I am pushing the ID of the property it acts upon into an array. I need my funtion to check if that ID is in the array already and if it is, remove it and execute my other function ...
Just for the sake of experimentation, I've been trying to determine different ways to non-destructively chain window.onload functions in a web browser. This is the idea of what I have so far:
var load = window.onload;
var newFunction = function(){
alert("ha!");
}
window.onload = function(){
load();
newFunction();
}
The pro...
Is anyone able to help with this universal rotate function (it's for jquery, but this is a javascript thing) : http://pastebin.com/m382b30e
I changed the non IE canvas code so it'll rotate around the image's center (see http://uptowar.com/jquery in firefox). Now I need to change the IE microsoft filter to do the same (see the same url i...
I'm having issues getting Firefox to update a webpage when its class is changed dynamically.
I'm using an html "table" element. When the user clicks a cell in the table header, my script toggles the class back and forth between 'sorted_asc' and 'sorted_des.' I have pseudo element which adds an arrow glyph (pointing up or down) depending...
I have been learning more and more javascript; it's a necessity at my job. We have a web application that uses a lot of javascript and I will be doing more and more every day. I have read bits and pieces about design patterns, but was wondering if someone could just give me a cut and dry example and definition. Are they something that wo...
Hi Guys,
Im trying to do a dialog box with jquery. In this dialog box Im going to have terms and conditions. The problem is that the dialog box is only displayed for the FIRST TIME.
This is the code.
JavaScript:
function showTOC()
{
$("#TOC").dialog({
modal: true,
overlay: {
opacity: 0.7,
...
I recently had to take a quick look at Adobe InDesign server. In this enviroment you write your interactions with the servers libs via JavaSscript.
This got me thinking, how could I use the Javascript language within a C# application so that I could expose set bits of functionality of my API/framework and allow others to write small pl...
Hi Guys,
How can I change CSS from javascripts. Im using JQUERY (Dialog) and I want to change the style of a DIV from javascript.
Thanks
...
Hi Guys,
I have a problem with the jquery-ui dialog box. The problem is that when I close the dialog box and then I click on the link that triggers it, it does not pop-up again unless I refresh the page. How can I call the dialog box back without refreshing the actual page. Have a look:
$(document).ready(function() {
$('#showTerms'...
On Stackers' recommendation, I have been reading Crockford's excellent Javascript: The Good Parts.
It's a great book, but since so much of it is devoted to describing the best way to use Javascript's basic functionality, I'm not sure how I can put his advice into practice without duplicating the efforts of many other Javascript programm...
What's the best way to animate a background image sliding to the left, and looping it? Say I've got a progress bar with a background I want to animate when it's active (like in Gnome or OS X).
I've been playing with the $(...).animate() function and trying to to modify the relevant CSS property, but I keep hitting a brick wall when tryi...