javascript

Nice vertical top-left menu tutorial

I saw a tutorial on the net about how to create a nice jQuery animated vertical navigation bar. It has a demo page that has a white clean background, this bar on the top left and some handwritten wording in the middle of the page. Please remind me that link. It looks similar to this one:http://nathanborror.com/ ...

Adding items to a javascript array

Hi, I'm attempting to assign items to an array on a users action, so for example, user clicks "Add", this will add the selected id into the relevant section of the array. The array won't be created at first so I set up an empty array: var Options={}; On the users click, I then want to assign a key to match the option selected from a...

Help with JQuery Callback

As per my previous question, I have a working animation which fades in and out each element within the div slideshow. The problem is that I want this animation to continue from the beginning once it has reached the last element. I figured that was easy and that I'd just place an infinite loop inside my JQuery function, but for some rea...

how to check flash player version using javascript ?

is it possible to check the version of the flash player installed in a browser using javascript ? thanks ...

What algorithm does Readability use for extracting text from URLs?

For a while, I've been trying to find a way of intelligently extracting the "relevant" text from a URL by eliminating the text related to ads and all the other clutter.After several months of researching, I gave it up as a problem that cannot be accurately determined. (I've tried different ways but none were reliable) A week back, I stu...

get the element that triggers a javascript function

i want to know if i can access the element that triggers a function in javascript. i know... it's kinda hard to understand but maybe if you see the following code you'll get what i try to explain: CODE HTML: <a href="javascript:myFunction(this)">link</a> CODE JS: function myFunction(linkElement) { console.log(linkElement); } Ob...

JavaScript innerHTML causing css to disappear on <button>

I have a button tag with two spans inside; <button><span><span id="buttonText">Save</span></span></button> I'm trying to make it so that when you click the button the text changes so I have; onclick="document.getElementById('buttonText').innerHTML = 'Saving...'; this.style.className" Now funnily enough it works fine in IE8, but te...

Prototype: How to know the prototype.js version using a js function?

In jQuery you can use $().jquery; and you can know your framework version, is there an equal script for prototype? Thank you! ...

i always get the same html

i need some help with this, i'm trying to generate some html with javascript, but always get the same, this is my javascript code var datePickerHTML = function(id){ var html = "<div id='"+id+"' class='ui-datepicker'>"; html += "Hello World, my ID is "+id; html += "</div>"; return html; } var UhmaCalendar = function(c...

Fixing the URl so there is no spaces

I have a button that has its location generated dynamically via jquery: <a id="final_location" href="/pre_config/step4" class="proceed-btn right">Proceed To Next Step &gt;&gt;&gt;</a> $('#final_location').click(function() { location.href = this.href + '/' + escape($('#type_of_station').html()) + '/' + ...

jQuery selectors: multiselect vs select

Hello, Is it possible, via jQuery, to select a multiselect to a select, differently? The issue I'm having is that I have a general js called that does something to an id. However on some pages it has a different purpose. Therefore I would like about to recognize the difference. $("select#categories[multiselect]").doOneThing; //multis...

Javascript for...in statement gives error when looping through array

I just tried the for...in statement in Javascript. This gives no error: var images = document.getElementsByTagName('img'); for(x in images){ document.write(images[x]) + " "); } However, this does what it should but gives an error in the FF error console. for(x in images){ images[x].style.visibility="visible"; } This made ...

Fixed position sidebar with jQuery

How do I incorporate the following sidebar menu feature using jQuery where the menu on the left re-appears as the user scrolls down the page? Here's an Example Sidebar Menu. Any help or available tutorials online would be much appreciated. ...

Get local IP address in node.js

I have a simple node.js program running on my machine and I want to get local IP address of PC on which is my program running. How do I get it with node.js? ...

Replacing a JavaScript function with a UserStyle

I'm working on modifying a UserStyle for Instapaper. Since the original UserStyle was written, Instapaper added to their header a number of JavaScript functions that control the width of the page and the typefaces used. Here they are: function loadDefaults() { _fontSize = 16; _fontFamily = "G"...

dynamical change td width with js

Hi, I need to change the width of a td using javascript. The value of the width will be pulled in and then I need to multiple it to get a percentage. I just need to know how to write the js so far I have got to here but it is not working <script language="JavaScript"> var divWidth = 66*0.4; document.write("<td width="+divWidth+">");...

RegEx: Find word after a letter but don't include the letter in the result.

Here's a string that I may have: (MyStringIsOneWholeWord *) I have used the following javascript regular expression to get the text after the bracket if it starts with My. /(^|\s|\()+My(\w+)/g, The problem with this is that it includes the first bracket in the result, as that it is the letter/character that found it. How would I ...

Add reset to defaults button to asp form but avoid postback

I have a couple of fields on a form that will be populated with default values. I would like to put a button that will allow me to reset those fields to their default values if they have been modified. However I would like to avoid the postback so that I don't have data being sent to the database. Is it possible to add a javascript hook...

apply class to html tag under IE(6)

Not a problem, but a question to upgrade my knowledge : <script type="text/javascript"> $(document).ready(function(){ if (jQuery.browser.msie) { //If js is not active we couldn't launch html5 compat script. //So we won't bother with conditionnal comments, slowing down engine rendering ...

CSS styles not applied on dynamic elements in Internet Explorer 7

When we render dynamic elements with Javascript in IE7, the CSS styles are not applied. When we use the Web Developer toolbar to view the page, the dynamic elements do not appear. Pages render fine in Firefox, Chrome, and Safari. Is IE7 unable to apply CSS styles to dynamically created elements? IE8 renders the dynamic elements prope...