javascript

jQuery handling hover() and unfinished animations on mouseout

Hello, Live Demo with visible code; http://jsfiddle.net/3eEgb/4/ The demo should be fairly self explanatory; I'm finding the length of a sentence inside a wrapper with the overflow hidden, and if it's wider than the wrapper I'm running an animation function that slides it along, revealing the remaining text. However I'm having problem...

Javascript Functionality Question - Appear on form entry...

Not really even sure what to call what I am trying to do so I will just explain. I have a section at the top of my site that I want to display announcement type messages. Theses messages will only be relevant to members of the site. As such, I would like for when they begin to type in their username and password, the div/message to appea...

copy events from one elm to other using jquery

==dom is like this== <a href='javascript:void(0)' id='link1'>elm with events bound initially</a> <a href='javascript:void(0)' id='link2'>elm to which events are bound in future</a> ====js== $(function(){ $('#link1').bind('click',function(){alert('do something to make me happy');}) }); //now some time in ...

TXT messaging or Email Autoresponder with dynamic or queryable response-?? Rails, .NET, Java, C++??

Hey guys, I wanted to write something that could receive text messages and respond with data queried information from my database. I have been playing around with this and discovered that you can send/receive text messages to email addresses. What would I need to write to have the a program to constantly check for new messages to an ...

Find html element nearest to position (relative or absolute)

Given absolute or relative position (top & left) is there any way to get the nearest html element to these co-ordinates? Or alternately, is there any way to craft a selector (or use some jQuery construct) to enumerate elements and then find which is closes to the provided co-ordinates? Assume that the set of elements is small and finite...

Adding dates in JavaScript in one line

Hi everyone, I'm trying to perform date manipulations using JavaScript on a single line, and I'm having problems with the year (not the month or day). I got the idea from this link. Am I missing something? The code is as follows: var newyear = new Date((new Date()).getYear(), (new Date()).getMonth(), (new Date()).getDate()+5).getFullYe...

Why does MS Ajax use named JS functions when creating object methods?

Looking at the MS Ajax libraries, I notice they define object methods like so: addErrors: function Sys_Mvc_FormContext$addErrors(messages) { /// <param name="messages" type="Array" elementType="String"> /// </param> if (!Sys.Mvc._validationUtil.arrayIsNullOrEmpty(messages)) { Array.addRange(this._errors, messages...

Screen Coordinates of a element, via Javascript

I'm trying to get the screen coordinates (that is, relative to the top left corner of the screen) of an element in a browser window. It's easy to get the size and position of the window (screenX, screenY) and it's easy (with jQuery) to get the offset of the element ($('element').offset().left). However, I need to know how many pixels it...

rotate large table ajax

hi everybody, I have a very large table (that overflows the content div) and because it's dynamic it can contain at least 20 columns. Anyway, the problem is that I'm obliged to put this table in a "tight" div. And, the idea is to avoid the overflow and, to display elegantly all the columns so that it can rotate horizontally (a slide fr...

Firefox extensions & XUL: get page source code

I am developing my first Firefox extension and for that I need to get the complete source code of the current page. How can I do that with XUL? ...

How can I get the previous page from history in classic ASP?

Is there a way I can get the previous page the user was at in classic ASP? I am looking for the equivalent of history.go(-1) in JavaScript. ...

jQuery image hover not working on Firefox, when I uploaded files to online server.

It was working fine on Firefox on local machine but when I uploaded the files online it just stopped animating and showing a static image. View it here The Javascript I am using: <script type="text/javascript"> $(document).ready(function() { $("ul.gallery li").hover(function() { //On hover... var thumbOver = $(this).find("img")....

Javascript: How to make this var. work globally.

I am having an issue with this variable not wanting to work outside the function and I just can't understand why! here's the code: globalData = new Array(); // // Colors // if ( settings.category == 'colors' ) { $.getJSON(colorLoversURL, function(data) { for ( var i in data ) { var localData = data[i].hex; globalData...

javascript eventlistener problem

Hi, I have a script where Im trying to add an eventlistener to a link, and it watches for when a user clicks the link. when the link gets clicked it calls the function 'hi'. im having trouble because the function 'hi' gets called even when the link isnt clicked. same result on IE and FF. heres my code maybe someone can help: function hi...

Title-changing effect/window event listener does not work

Hello, I tried to search but could not find out anything useful. This is a piece of code for my Greasemonkey script. Basically, I want to have the same effect as Gmail. When the page loads and you have new messages, the title will change repeatedly and make you notice. The problem is it does not work for the first time. For example: The...

Google Calendar integration with Classic ASP

Hiya, I need to integrate a google calendar to my ASP website booking system. I've tried to write events to the calendar from my application using the javascript API, but it's failing when the client is not logged in to Gmail - obviously a problem if my customers aren't logged in my Gmail account. Therefore I assume it's not possible ...

Why does JSLint returns 'bad escapement' on this line of code ?

Why is it that JSLint returns a 'Bad escapement' on the following JavaScript line ? param = param.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); From JSLint documentation I thought that this would be ok since the regex literal is preceeded by a parenthesis: Regular expressions are written in a terse and cryptic notation. JSLint ...

Loading the Language Class in ExpressionEngine for PHP Scripts not loaded by ExpressionEngine

Basically, what I need is a way for a PHP script called using ajax to access ExpressionEngine's $LANG superglobal. I'm using ExpressionEngine 1.6.8 core, and jQuery for ajax. My setup is that I have an extension that uses the publish_form_end hook to add some content and javascript to the publish form. The content will be dynamically upd...

Is there a way to call a Return for a parent function from a child function in javascript?

I am having a really peculiar case. I want to return some data - data that is downloaded via ajax. So far async & sync modes don't get the data in time to the return. Is it possible I could either call return from a child function for the parent function or could a timeOut solve the issue? I can't think of another way of doing this, but ...

JavaScript/MooTools: IE 6?

What's the easiest way to tell if the browser is an IE 6 version in JavaScript? We're using MooTools here and Browser.Engine.trident will be true if it's IE, but what about the version number? ...