Why does this script bail out (IE) or stick (FF) at the first table cell containing text that it finds?
<!html>
<head>
<script type="text/javascript">
function CheckChildren(obj)
{
alert(obj.id + ' ' + obj.tagName + ' ' + obj.childNodes.length);
for ( i = 0; i < obj.childNodes.length; i++)
{
Check...
<a href="#">Domain name<span class="value">2</span></a>
I would like to retrieve only the text "Domain name".
I have tried using $('a').text() but that will also get the text inside the descending SPAN tag. Is there a way to select only the first text node inside the A tag somehow?
I can't figure out how.
.contents('not:(span)') do...
I have seen a few threads explaining that Flash can be used to set the clipboard data in Mozilla and Internet Explorer, it's easy, etc.
For example http://stackoverflow.com/questions/316508/greasemonkey-javascript-copy-to-clipboard-button
However, I would like to read the clipboard and remove certain items before setting it. Is there a...
The short version: Is it possible to switch to alternate XSL stylesheets in the browser, a la CSS stylesheet switching?
The long version:
I've always admired the CSS Zen Garden; it excellently showcases the power and flexibility of stylesheets. However, it also shines a light on one of the great weaknesses of CSS: a quick View Source ...
Does JavaScript have a mechanism for determining the line number of the currently executing statement (and if so, what is it)?
...
I have sensitive files to download to users, and each user is permitted to download a given file exactly once. If the download fails, I want to permit the re-download, but not otherwise.
It's not sufficient to rely on logging/processing the file download request at the server - I need to know deterministically when the file is complete...
Maybe is a trivial problem, i don't know why this function exit from for cycle when it goes on else statement.
I need this function to fetch an xml document.
function xmlToArray(element){
childs= element.childNodes;
if(childs.length != 1){
for(var i=0;i<childs.length;i++){
if(childs[i].hasChildNodes()){
x...
How is it possible to only use ()[]+! to make javascript code?
Ex:
http://discogscounter.getfreehosting.co.uk/js-noalnum.php
...
What scope does the strict mode pragma have in ECMAScript5?
"use strict";
I'd like to do this (mainly because JSLint doesn't complain about it):
"use strict";
(function () {
// my stuff here...
}());
But I'm not sure if that would break other code or not. I know that I can do this, which will scope the pragma to the function...
...
Hi
I want to find some HTML codes for 3d games would you send me some links for it? i have searched a lot but they were not good!
thanks
...
Hi all,
I'm trying to figure out if I can do the following:
User submits form to script via jquery post
Depending on what was processed, script may or may not return errors
If the script did not process any errors (i.e. SUCCESS), I want to redirect to a SUCCESS page
I know it's possible to redirect the browser via javascript, but I'...
I'm trying to implement a JavaScript component that captures key-inputs and creates a command prompt interface for the web, I don't want to use text-fields
It's easy to capture input from keys as follows:
$('*').bind( 'keypress', keypressCaptureFunction )
but the bubbling of events is giving me multiple events per key-press, also, us...
Having this fieldset:
<fieldset>
<legend>[*death]</legend>
<select name=death style="width: 120px">
<option value=Dead>[*died]
<option value=NotDead>[*alive]
<option value="" selected>-
</select>
</fieldset>
i want to set the [2].value to "-"
i have tried without any success:
document.getElements...
I am seeking your stories on how you have streamlined your client side development with Visual Studio. In particular, it seems that I need to build my site too often in order for changes to pushed down to IE effectively. What shortcuts or tools like FireBug, etc. do you use for your client side development? Do you avoid Visual Studio ...
hello, i am trying to get the headers of an ajax request i made through jquery
$.get(url,
function(response, textStatus, headers ) {
console.log("Response: %o", response);
console.log("TextStatus: %o", textStatus);
console.log("Request: %o", headers);
}
);
this does not seem to be working however:
th...
I am working on an application which sends an AJAX POST request (I'm using jQuery currently) every 1500ms. I have noticed that most of the times, these requests succeed within 350-450ms and are sent to the server nicely in the same order as they are generated.
However sometimes, one or two requests take nearly 3-4 seconds and they are ...
ok, here's the deal:
I'm using a nice plugin I got from http://www.webmotionuk.co.uk/php-jquery-image-upload-and-crop/
It's nice and all, but it doesn't solve a particular problem: I'll have users uploading images of differing sizes and aspect ratios, so, here's what they provided:
function preview(img, selection) {
var scaleX = 160...
How is randomness achieved with Math.random in javascript? I've made something that picks between around 50 different options randomly. I'm wondering how comfortable I should be with using Math.random to get my randomness.
...
I'm looking for a way to handle calls to undefined methods and properties in JavaScript.
These would be similar to the PHP magic methods __call, __callStatic, __get.
An example of the code using this might be:
var myObject = {};
myObject.__call = function (called, args) {
alert(called);
alert(args);
return(true);
}
myOb...
Hi folks,
I have a very novice question, so apologies if the answer to this is obvious.
I am using JQuery to toggle the contents of items based on whether the item has been clicked. I have been able to successfully implement the toggle feature.
I now need to have it load with the first two items set to show() with the rest set to hide...