javascript

Changing the interval of SetInterval while it's running

I have written a javascript function that uses setInterval to manipulate a string every tenth of a second for a certain number of iterations. function timer() { var section = document.getElementById('txt').value; var len = section.length; var rands = new Array(); for (i=0; i<len; i++) { rands.push(Math.floor(Mat...

Drop-down js menu blinking in IE7

Hover over the menu on my site, and the drop-down appears correctly in Firefox, but in IE7 (and probably 6, I haven't been able to check yet) it blinks, repeatedly, even after you take away the mouse. http://preview.sgwl.net/ I'm pretty sure this has to do with the CSS customizations I've made to the menu, but for the life of me I can...

repeating id's of element children

Is it ok to have id names for children of an element the same as the ids of children of another element provided the parent id is different? Any potential conflict? ...

Problem Embedding External JavaScript in HTML page

I am trying to embed a 3rd party chart (Twist) into an HTML page. Also on the HTML page, I am using a text input to allow for a user to dynamically enter new parameters to be sent to Twist. In javascript, I am attempting to append the text input to the end of the call to the external chart. I cannot, however, figure out how to have ...

How do you get the viewport scale after pinch/zoom on an iPhone web app?

Does anyone know how to get the size in pixels or scale value of the viewport after a user has pinched or double tapped to zoom in/out on a page in JavaScript? I've tried using window.innerWidth but I've had mixed results. Sometimes it seems to accurately give the number of pixels the viewport is showing, however, if I zoom way in on a ...

Extract parameter value from url using regular expressions

This should be very simple ( when you know the answer ). From this question I want to give it a try to the posted solution. And my question is: How to get the parameter value of a given url using javascript regexp? I have: http://www.youtube.com/watch?v=Ahg6qcgoay4 I need: Ahg6qcgoay4 I tried: http://www.youtube.com/watch\\?...

How can I reduce page reflows when using JavaScript widgets?

A lot of JavaScript libraries have user interface widgets. Usually they are created after the page is loaded. The user sees a page re-flow and parts of the page shift around or change appearance. How can I reduce the amount of reflowing that occurs when a page loads, especially if I’m using several widgets? Here’s some examples. These...

Given an x,y coordinate, I need to find all html elements underneath it.

I am building an app where I repeatedly need to get lists of html elements sitting under a specific location (x,y relative to the viewport, e.g.). I am considering the following approaches, but none are satisfying: (1) Go through the html, build a data-structure that keeps track of the x,y position of every element (x,y -> set of eleme...

Anyone tell me why this Jquery doesn't work in IE?

The following code works fine in FF chrome etc but not IE, anyone know why? Basically everything works accept the replacement of the image attribute $("#container #main_image img#largeId").attr({ src: largePath }); Even the rest of the function ie the swapping classes works, just not the image replacement. The full example can be see...

Using Google AJAX Feed API Feedcontrol, I need a callback

I'm actually using the jQuery Google Feed Plugin to manually add some feeds to my site. One feed includes a photobucket album which I'd like to provide a preview of each image. I can't find a callback for the FeedControl class in the API documentation. Is there an better way to do this other than using a settimer? ...

How do I run PHP code when a user clicks on a link?

I want to have a page run some PHP code when a user clicks on a link, without redirecting them. Is this possible with <a href=""></a> or with the javascript onclick event? ...

Javascript IE and getElementsByClassName problems

So first off I am learning JS and will not use a library until I know all I need to. http://www.tombarrasso.com/search/ With that said why on earth does my code not work in < IE 7, Firefox < 3, etc? Safari 4 is perfect, Firefox 3.5 is great, etc. I am using the function getElementsByClassName from Robert Nyman. It generates no errors ...

A small javascript library for cross platform mouse handling?

Is there a library that gives me a stable API upon which to handle mouse input for Javascript? All I wan't is mouse handling, but if tjere is a great library that doesn't affect other things too much thats also ok. ...

Javascript to check internet connection

Possible Duplicate: JavaScript: How to detect that the internet connection is offline? How to check the internet is connected or not in javascript. ...

(Javascript) Working with Prototype, multiple jQuery related libraries...?

Hi All, I've seen a million different posts and (as odds would have it) a million different answers regarding how to include multiple jQuery libraries/plugins along with unrelated libraries/plugins. My main concern are the ones that require jQuery themselves. Basically I'm using Prototype, jQuery, jQueryUI, and jQuery.dropshadow.js. ...

javascript onmouseout applied to div fired by children

Hi I'm having trouble finding a solution to this via google but I would have assumed it would be quite a common problem. I have a div which I have applied an onmouseout event handler to (the handler is used to roll a menu up using jquerys "slideup" function, as I would like the menu to be hidden when the mouse leaves). Problem is that t...

Is Greasemonkey not capable of using jQuery's full power?

Hey guys, I'm trying to find an element using jQuery, but it is not working.. I found out that this kind of selector can't be done in Greasemonkey: ($("#app7019261521_hover_container > [id^=app7019261521_the_coin]")) Please help me translate this into raw Javascript. This kind of selector is hardcore to do in Javascript. Please help ...

array walk and replace in php or Javascript(phpjs)

<?php $frndof=array("name"=>'frnd_of_xyx',"id"=>001,"url"=>'tutorboy.com/frnd_of_xyx', "address"=>array("city"=>'NewZend',"zip"=>'100450')); $frndof1=array("name"=>'frnd_of_xyx1',"id"=>0011,"url"=>'tutorboy.com/frnd_of_xyx1', "frnds"=>$frndof,"address"=>array("city"=>'NewZend1',"zip"=>'100422')); $a = array( array("name"=>'xyx',"id"=>001...

Dynamically updating part of a page for all users

I want to dynamically updating a part of a web page for all users on it when I chose to (through a seperate page). The scenario I'm thinking of: Say there's a chat box and a picture on a page. When I click a button on another page (or the same), the picture changes to an embedded youtube video for all users on the page chatting. Wha...

Need javacript sorter (pref. jquery) that doesn't clone elements

So far I've tried Tiny Table Sorter, Tables on Cows, Sorttable, and Yoast's Sortable-table plugin. I have the last one currently installed on a test page here. I finally don't get a conflict w/ the qtip script I'm running on the same page. I understand that the conflicts arrive from a sorter that uses cloned elements. Unfortunately, the...