javascript

What am I doing wrong with this call to document.getElementById

I have the following javascript code var myDiv = document.getElementById("myDiv"); alert(myDiv); myDiv.style.display = 'none'; the call to alert(myDiv) succesfully shows that myDiv is not null and I see that the object (the div) has all the necessary properties set etc. However, the call to myDiv.style.display = none ...

Disable original javascript keypress event and replace dynamically

Currently I have a textarea with an onkeypress event specified in the HTML tag. I am trying to capture this keypress and save it as a function that will be used to override it, as I want to add another condition to when it is run. Here is the code I am trying to implement. $(document).ready(function(e) { var defaultKeypress = $('t...

Pop-up image with live text

What I'm trying to do is have a cool little window or image with live text in it pop up like an alt except... I want it to open when you roll over a specific line of text... Suggestions anyone??? ...

Get css value without DOM element

Hi all, I am wondering if there is a way to get css value from stylesheet file when there is no element in the DOM using it? I am using jQuery and I use selector $(".classname").css() to get the values. But with the case "classname" is not in any element, what to do to get the value" Thanks ...

IE: why isn't AJAX resulting HTML updated in DOM?

I'm loading html content via ajax onto a div (using mootools 1.11 and squeezebox, if it matters). In the content that I load I have some JS that manipulates some of the loaded HTML objects. Everything works fine in FF, but when I load it in IE (tested on IE7 for now) the code fails with "'null' is null or not an object. A quick test show...

Enumeration of event handlers

Is there a way to list all event handlers an html element supports? ...

Passing values to onclick

If I create a whole lot of HTML elements using a loop, like for (i= 1; i < 100; i++) { var my_element = document.createElement ("td"); row.appendChild (my_element); my_element.onclick = function () {my_function (i)); } then when the element is clicked, the value of i passed to my_function is always 100, regardless of what ...

Why doesn't jQuery Tablesorter Plugin work on this Wordpress page?

I have a working example of the Wordpress/jQuery plugin on this test page: http://beerlyrics.com/jimmy-jones/ I hardcoded it into the header on this page and both the pagination and filter mechanisms work correctly. I have converted this over to a new page and am now using wp_enqueue to call all my scripts as it is supposed to be done:...

Refresh an elements style in Javascript

I have a table which the rows are loaded dynamically from a recordset. I also have used Javascript so that when a checkbox (not in the table) is checked it hides all the rows when column x = y, but I have a vertical border (really just a background image positioned to the right)which fades on the last row of the table using the CSS .sort...

javascript tutorial

Hello, I need to do some scripts in java script. I am working on it but couldn't find a few solutions to a few problems. First of all I need a GOOD tutorial, but not for an internet page but for a DESKTOP script. Things couldn't find out like : 1) I wanted a simple message box inorder to debug my program, I used: var name = prompt("Wh...

How would I position a marker at the bottom of the map in Google Maps v2?

I have a webpage that finds a store by postcode or name. I have just released an update to it so that contact details display in an info window coming from the marker. Due to the small size of the info window, after centering to the marker, the map pans down until it can fit the marker and info window in leaving the marker near the bot...

jQuery Key Events with a Search Box

Hello all, I'm working on an autosuggest plugin with jQuery, and I'd like to add Keypress events so that users can arrow down and up. Also, if they press enter it will add the value to the input. This is what my HTML looks like: <input id="myInput" class="textInput" type="text" name="instructorName"/> <label for="search"> </...

Javascript for CSS style modification inside Google Chrome browser

Hi, I'm facing a weird problem developing a web application as compatible as possible with most popular browsers : I've got a HTML which I want to move inside the page from its original position to another just by clicking on a button. Here is the HTML code : <div id="content"> text content ... </div> The associat...

Mootools Numeric Textox

dear friends I am looking for numeric textbox control based on mootools framework. i'd be grateful if someone help me to find or implement this control. thank you . Alimz ...

Circular buffer in JavaScript

I was wondering whether anyone has already implemented a circular buffer in JavaScript? How would you do that without having pointers? ...

javascript not generating in browser, just prints code to screen

First off, I am not asking anyone to do my homework :P The point of this was to write a simple webpage to become familiar with javascript. It generates and displays random cards from a folder called 'cards'. I completed that part. However, when I submitted it to the teacher he sent me back this screenshot with the subject line "any ideas...

Firefox addon code for every tab open

I'm attaching some functionality to javascript by doing a firefox addon. However when coding in chrome and listening to the load event in the chrome overlay triggers for every loaded tab, but the "content" variable only points to the tab currently in the foreground. How can I get the content of every tab upon document load from a firefo...

Search For Words, Replace With Links.

I have an array like this var words = [ { word: 'Something', link: 'http://www.something.com' }, { word: 'Something Else', link: 'http://www.something.com/else' } ]; I want it to search the page for word and replace it with link. Is there an efficent way of doing this? It seems it may be CPU hungry...

Prototype Selection Help

Hey guys, I'm trying to make a small addition to a web app I use. Right now I am trying to check all of the checkboxes on the page which have class .checkBox (In case it is needed to differentiate/select). The checkboxes are descendants of divs of class .someClass, it's just that there are many divs which have that class. I want to check...

javascript and greasemonkey question

i wanna get a price inside a page and then multiple it by 0.93 then write the result after first price. but i couldn't be able to grab the price from page. for example i want to grap "900 TL" string from "900 TL" you can see all codes of page by visiting http://www.sahibinden.com/cok%5Ftemiz%5Fasus%5Ff3jp%5Ft7200%5F2ghz%5F2gb%5Fram%5F...