javascript

Add more behavior to existing onclick attribute in javascript

Hi, how can i add more behaviour to existing onclick events e.g. if the existing object looks like <a href="http://abc" onclick="sayHello()">link</a> <script> function sayHello(){ alert('hello'); } function sayGoodMorning(){ alert('Good Morning'); } </script> how can i add more behavior to the onclick that would do also the ...

jquery radio cannot change after 1st selection!

I have the following stucture: #main.accordion() h4#header1 <table><tbody><tr><td> <input type=radio name=1_1 value=1 id=1_1><label for='1_1'>1</label> <input type=radio name=1_1 value=2 id=1_2><label for='1_2'>2</label> <ul>some text</ul> With several h4 headers of similar structure. When I click on t...

javascript - find number in string

Possible Duplicate: Regex using javascript to return just numbers. How do I get the humber from a string like this? blabla-33434 ...

Changing CSS3's translate while retaining other values?

Hi, I have an element that has -moz-transform applied to it with translateX(), translateY() and skew(). What I need to do is to alter the skew() value without touching the translations, using javascript. How would I accomplish this? ...

How to toggle every jQuery element except the clicked?

So I'm trying to achieve something seemingly very basic in jQuery. I have a number of "headers," and when I click on a header I want the info beneath that header to slide down, and all other header info to slide up (so that only one header is showing info at a time). Here's sudo code of what I want to happen: $('.more-info-header:not(...

regex to find tag id and content JavaScript

Hey I'm trying to do something quite specific with regex in javascript and my regexp-foo is shakey at best. Wondered if there were any pros out there who could point me in the right direction. So I have some text... <item id="myid1">myitem1</item> <item id="myid2">myitem2</item> ...etc And I would like to strip it out into an array t...

servlet, jsp and user feedback from form

Hi there, I have been straggling as to how to implement the following scenario. Any guidance would be much appreciated. I have a form that the user fills in. Using jquery it is validated as much as possible before sending to the server. When the submit button is click the form is send to a servlet. The servlet will then check the db a...

How can I ensure a dynamically-generated javascript file is never cached?

I have a dynamically-generated javascript file that I want to ensure is NEVER cached by the browser. My current method is to simply append a (new) guid to the url in the script tag on each page view. For example: <script type="text/javascript" src="/js/dynamic.js?rand=979F861A-C487-4AA8-8BD6-84E7988BD460"></script> My question is...i...

Java script - Keep buttons hidden until page load

I have built a horizontal scrolling website. I don't really know much about Java Script, but I downloaded this script called Horizontal Tiny Scroller that lets you scroll the website horizontally, without using the scroll bar. Everything works perfectly except the script only loads once everything else on the page has finished loading. ...

What 'html5' frontend tech to use for a drag and drop team management app?

Hi, Background: I'm trying to build a web app (as a personal project using modern browsers only) that will leverage the http://www.blackoutrugby.com API. This is an online rugby mgt simulation game. The intention is to offer something powerful to the user which will calculate best teams based on current stats from their team and oppone...

How can I make infowindows resize for tweets in Google Maps v3 with Javascript

Hi, I'm trying to add a few tweets to an infowindow in Google Maps. I get the tweets to display in a div that is the content of my infowindow, but it's the wrong size. I thought by calling 'content_changed' when the marker is clicked, the infowindow would resize - it doesn't. I'm sure this is pretty straightforward, can someone help m...

Javascript document.write weird behaviour in Firefox

Hi all, When I write the following code directly into my html page under a script tag, the string "test" gets appended to my page without replacing the rest of its content (1): document.write("test"); However, if I place that same code into a separate javascript file like (2): <script src="http://127.0.0.1/whatever.js" type="text/ja...

Position element near another one, always on the visible portion of page

Hello, I have always the same problem with displaying simple dialog boxes. The markup is as follows: <li class="clickable">element <ul class="options"> <li><a href="#">Option 1 with long name</a></li> <li><a href="#">Option 2 with long name</a></li> <!-- ... more similar options --> </ul> </li> $('ul...

postMessage doesn't work in GreaseMonkey because it cannot acces contentWindow property on cross-domain iframe but in pure Firefox it will work

here are bunch of codes isolating this problem: create 3 files on local server: test.html <SCRIPT language="JavaScript" SRC="http://localhost/postmsg.js"&gt;&lt;/SCRIPT&gt; <iframe src="http://127.0.0.1/iframe.htm" id="iframe"></iframe> <div>Click anywhere on this page to see message from embedded iframe, which do not need to be on ...

jQuery lightbox problem

I got two divs, one is a background and the other is the container for a vid which is on top of the former. Another div serves as a button that when clicked, it triggers the lightbox. Here's my code: //0 means disabled; 1 means enabled; var popupStatus = 0; var buttonDivID = ""; var conDivID = ""; //determine which div is clicked fun...

How to disable autoload in jqGrid?

Hi! How to disable autoload in jqGrid and load data manually when I need it? Thanks. ...

Wrong parameter is being set to function on a succesful jquery $.ajax get

I have an array that stores a few urls of XML files that need to be downloaded. On success, these files need to be processed. But that is where it goes wrong. The problem is quite apparent: for (var i = 0; i < loadMaps.length; i++){ var currentMap = loadMaps[i]; $.ajax({ type: "GET", url: currentMap, dataType...

modify click event script to be more specific

I have to the following function that I would like to modify so that it only binds the click event to all href's that = /ShoppingCart.asp?ProductCode="whatever" (whatever = whatever is in there") but not if it is specifically /ShoppingCart.asp?ProductCode="GFT". It must also check or convert a gft or Gft to upper case to check for those ...

Not Implemented IE8: Working around this?

I get an error on this line in IE8 with the Not Implemented error. How do i execute this line on other browsers and have IE8 ignore this? window.onbeforeunload = function () { This is weird. Theres nothing inside of this that should cause an error. This script is loaded at the end of body so all html exist and moving this code to the ...

Simple Javascript window opener acting crazy

Look at this script: <a href="brooklyn.swf" onclick=" window.open( 'brooklyn.swf', 'Start Here: Brooklyn', 'toolbar=no,menubar=no,resizable=no,width=870,height=650,scrollbars=no' ); return false"> Launch animated presentation &gt;&gt; </a> Can anybody explain why the resizable=no does not work in Safari or Firefo...