I want all buttons to perform an action before and after their normal onclick event. So I came up with the "brilliant" idea of looping through all those elements and creating a wrapper function.
This appeared to work pretty well when I tested it, but when I integrated it into our app, it fell apart. I traced it down to the 'this' valu...
Here is my issue. I have an array containing the name of cities that I need to lookup the weather for. So I'm looping through each city and performing an AJAX request to retrieve the weather.
var LOCATION = 'http://www.google.com/ig/api?weather=';
$( document ).ready( function() {
for( var cityIdx = 0; cityIdx < cities.length; city...
Preface: I have jQuery and jQuery UI included on a page.
I have this function defined:
function swap(sel) {
if (1 == 1) {
$(sel).hide('drop',{direction:'left'});
}
}
How do I fix the (1 == 1) part to test to see if the element is already hidden and then bring it back if it is. I'm sure this is easy,...
Hi, right now i have a jsp page that allows to sort some items, when is ready and a link is clicked a javascript function converts all the info into xml (text in a variable), after this i need to send this xml to the jsp page again, i tried putting the info in a hidden input and submiting the form, sending with $.post and a few more jque...
I want to split up the jQuery .js file into two, but I have noticed some of the features arent working when I split it up. Is it because I have two external scripts that start with:
$(document).ready(function(){
Is that not possible?
...
What's the best method for handling a situation where you have an ASP.Net Dropdownlist that is used to link to another URL
edited for clarity
Here's the basic scenario:
Dropdownlist with 5 cities bound to it
Selecting one of the cities should send me to a URL based on the city
Right now I am posting back using the "OnSelectedIndexCh...
I would like to use the Windows Common Dialog "Open File", to get a file from the user under JScript. This used to be possible using "ShowOpen()" on MSCOMDLG.commondialog object but, I can't find an equivalent way to do this that works under Vista.
...
Is there any recommended solutions when an embedding a script that will make a callback to the originating source but the js resides in a different domain. Sometimes other clients would be in a different domain and I can't rely on getting the document or window location.
Currently, I've been using this but not too happy with this solut...
I am trying to figure out the location of the script tag the current javascript is running in. These are dynamically generated tags.... code snippet:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>where am i?</title>
<script type="text/javascript" charset="utf-8">
function byId(i...
In the asp.net ajax library, there is a line that make me confused.
Type.prototype.registerClass = function Type$registerClass(typeName, baseType, interfaceTypes) {
//..
this.prototype.constructor = this;
//..
}
I known that (this.prototype.constructor === this) == true, so what is significance of this line? I remove the line, and t...
The Problem
I am working on an in-browser editor within a textarea. I have started looking for some information on dealing with textarea selection and found this jQuery plugin that does some simple manipulation. However, it doesn't explain what's going on.
The Question
Where can I find a good resource on Textarea Selection in JavaSc...
Background
I'm using POST form submissions instead of links with concatenated arguments inside a Web application, so I can exercise control over input.
Unfortunately this means users can't use the quick shortcuts they know to open links in new windows, like control-clicking or middle-clicking.
Problem
I've got what seems to be a work...
I am wondering how I can read CSS comments out of a linked stylesheet.
I have this sample CSS loaded via:
<link rel="stylesheet" type="text/css" media="all" href="test.css" />
#test1{ border:1px solid #000; }
#test2{ border:1px solid #000; }
#test3{/* sample comment text I'm trying to read */}
I'm testing this in FF3. The follow...
I recently wrote some javascript code that filled a drop down list based on some XML, pretty simple stuff. The problem was I had to write similar code to do almost the same thing on a different page.
Because the code was almost identical I named most of the functions the same, thinking that they would never be included in the same page...
I am going offline for a few days, and would like to bring the javascript documentation with me on my laptop :)
Does anyone know of a place where I can get downloadable reference documentation for javascript, preferably for firefox?
I have cheked the mozilla site, but have only been able to find an online version.
Thanks, Jonas
...
Is there a way to access an Excel worksheet using javascript?
...
I'm using an iframe to display content that has links. When the user clicks around in the iFrame and hits "back," it goes back in the iFrame. This behavior is OK. However, once they're back to the first page of the iFrame and they hit "back" again, the entire window is taken back to the previous page. This is unwanted.
To prevent th...
I'd like to write a function in Javascript along the lines of:
in_subnet(ip, network, slash) {
...
}
in_subnet('1.2.3.4', '1.2.0.0', 16) # True, since it's in 1.2.0.0/16
in_subnet('1.2.3.4', '1.2.0.0', 24) # False, since it's not in 1.2.0.0/24
Should I write it from scratch, or are there some good libraries I could use? Or is the...
Haven't been able to find anything particular to this situation online so here i go...
I need to set/get the cookies stored at "first.com" while browsing "second.com", I have full access of "first.com" but i only have javascript access (can manipulate the DOM as i want) on "second.com".
My first approach was to create an iframe on secon...
I'm trying to develop a firefox extension that inserts additional HTTP header fields into outgoing HTTP requests (to interface with an apache extension i'm concurrently developing).
While I understand the individual components of an extension and understand the basic tutorials that are presented on the web, I'm finding it difficult goin...