javascript

Why is the indented text still showing in IE7?

I have am using an image button instead of text for a submit button here and I have used text-indent -9999px to "hide" the text value. However, in IE7 that text is still showing over the button. I tried making the text transparent but that didn't help. Is there something I am missing here? HTML: <form action="news.php" method="post">...

datepicker in php

Hi all, I am using the jquery datepicker and I formated my date as "yy-mm-dd" and from PHP my date format is "Y-m-d". I did an alert and viewed the selected date in the "onSelect" event for the datepicker. Within this event I am using ajax via the jquery "load" function to load content into a div. My problem is very odd behavior! For som...

Sharing a session between Node.js app and Rails app

I'm running a Rails app on Heroku, and I'm trying to port over all inline Twitter requests (namely oauth authentication) to a Node.js app, because when Twitter is slow, since the Ruby server is blocking, the Twitter requests clog up my app. (My average request takes about 50ms, but my average Twitter Oauth request takes about 1500ms!) T...

Disabling click event handlers

I am trying to basically disable the click event on a <div> temporarily. I have tried the following (preview): $('hello').observe('click', function (e) { e.stop(); }); $('hello').observe('click', function (e) { alert('click not stopped!'); }); However, when #hello is clicked, the alert box still appears. I do not want the s...

RegularExpression String replace

I have html code as a string variable like a = "<span> Spain will win ....... </span>" and I want to heightlight "spa" in the String. I have to use RegExp, How should I write the pattern that it ignores the "spa" on span tag, but highlight in Spain. Thanks ...

JSON Object Array of Properties

I've been trying to figure out this particular object for quite a while and it's frustrating me endlessly so I was hoping to get it resolved here. I have an object that looks like this: options = { headers: { rows: [ cols = { text: "Blah", span: 12, color: "#FFF" ...

How to get width in specified units (pt, ex, etc.)

Hi, In my script, i need to get width of an element in "ex" units (font width) Is there any way to do this using JavaScript, jQuery ? ...

HTML Javascript, checkbox toggles label and dropdown list visibility

I'm halfway to getting this correct, but i am currently stuck. Firstly i would like the label and dropdown to be hidden be default. This i have achieved using css: unis { visibility:hidden; } The bit i am slightly stuck on is how to group the items, i have used: <div class='row'> <div id = "unis"> ...

What is the best and most comprehensive JavaScript graphing and plotting API?

I really want something that is eye catching and modern. I like how Digg does the Digg swarm (http://labs.digg.com/swarm/) ...

jQuery - watch for element height change

Hi I have a element, which is absolute positioned and has a fixed height. This element has a lot of child elements, which could change their contents, and in consequence their height. The problem is that the container element doesn't auto expand to fit its children (because of it's fixed height and absolute position). How can I can re...

Dynamically change a div's ID?

I have a bunch of divs with weird id and each of them contains a video. They're actually video embed codes but they're not usual to me. Here's one example: <div id="evp-1fae4e37639894816f03591bc7009c68-wrap" class="evp-video-wrap"></div><script type="text/javascript" src="http://domain.com/evp/framework.php?div_id=evp-1fae4e37639894816...

Dynamic Gauge Gadget for Windows 7

I am developing a dynamic gauge gadget for windows 7. I have an ASP.NET gauge user control. I am currently forwarding the gadgets default.html page to an ASP.NET page using the <meta> tag. Using this tag prevents the ASP.NET page from opening in a new window. I have tried using javascript's "location" to perform the redirect, however it ...

jQuery .load() call doesn't work in Firefox - why?

I'm a newbie programmer working with jQuery and wonder if anyone can help me out. Essentially, I've created some html for a social button's section on our articles. I've uploaded that with the aim of using jQuery's .load() function to pull it into every article. It works in IE7, but not in Firefox or Chrome. Can anyone help fix it? <...

Smoothly preload largeish background images

I have a site which uses largeish (60-100k) background images which vary from page to page. When the user loads the page for the fist time, the page content is loaded first and the background image appears a short time after. This is, I understand, intended behavior in browsers but it makes the page loading look quite "bumpy" on slow...

javascript parseFloat '500,000' returns 500 when I need 500000

How would it be a nice way of handling this? I already thought on removing the comma and then parsing to float. Do you know a better/cleaner way? Thanks ...

Convert GMT timestamp (DD/MM/YYYY) to local time (MM/DD/YYYY) in JavaScript

The timestamp I get from a server's SOAP response is formatted in European Notation and in GMT time (ex: 08/07/2010 11:22:00 AM). I want to convert it to local time and change the formatting to (MM/DD/2010 HH:MM:SS AM/PM). I know about the JavaScript Date object but can't figure out the logic of how to do the conversion. Can anyone help...

Client side XSLT transformation of someone else's XML.

A third-party supplier is providing me with some XML, that one of my applications is happily processing. For debugging reasons, I want to look at it, but it doesn't display anything in the browser, and I (and other members of my team) have to viewsource to look at the (ugly) XML. This sounds like a classic use-case for XSLT, I thought. ...

Outlook attachments and Javascript

So I have a security issue with my fresh install of Outlook 2003 (on Windows 7 + Internet Explorer 8). I just received an email with an HTML page attached. I (stupidly) double clicked the attachment, which opened up IE, and which contained javascript that ran and took me to a malware site. Some interesting facts: (1) When I create an...

Refactoring method that was previously injected with implement

Greetings, I'm trying to override or extend the Element.show() and .hide() methods in mootools in order to add some WAI-Aria toggling. I was trying to use the Class.Refactor() method like this: Element = Class.refactor(Element, { show: function(displayString) { result = this.previous(displayString); // Do my thing return...

Extract src attribute from script tag and parse according to particular matches

So, I have to determine page type in a proprietary CRM, using JavaScript. The only way to determine the page type (that is, the only consistent difference on the front end) is by examining a script tag (out of many list) whose src attribute begins with /modules/. In a list of a dozen or so script tags in the header, each page has a lin...