javascript

jQuery gallery turn over with next and previous buttons

Hi, i'm trying to do some kind of Gallery-Turn Over Script with jQuery. Therefor i got an array with - let's say 13 - images: galleryImages = new Array( 'images/tb_01.jpg', 'images/tb_02.jpg', 'images/tb_03.jpg', 'images/tb_04.jpg', 'images/tb_05.jpg', 'images/tb_06.jpg', 'images/tb_07.jpg', 'images/tb_08.jpg', 'images/tb_09.jpg', 'imag...

How to create url preview in JavaScript?

Can someone help me with creation of a url previews in JavaScript? What I mean is this: Say I have a link on my site, I want the user to be able to mouse over the link, and have an image pop up that shows what the target of the link looks like. Don't worry about the css, I got that working, I just need the actual script to show the im...

Making "helper" text in a form be a different color then typed text.

<input name="phone" type="text" id="phone" value="Phone #" onfocus="value=''"> I've got two problems here. The main one is I would like the helper text (in this case "Phone Number") to be a different color then the inputted text from the user, to make it easier for the user to differentiate between filled and unfilled fields. The seco...

Javascript's onclick event causes the page to reload in ie-8, but not in firefox, safari,chrome and opera?

Hello, I have an onclick event attached to a button. Clicking the button adds a text box to the target div. the code is: onclick="return addBlank("param1","param2"); The function addBlank does not have a return statement. Clicking on the button behaves as intended in firefox, opera,chrome and safari - i.e., an empty text...

Undo implementation - DOM manipulations

Is there a library that can be used for implementing undo/redo functionality for DOM element manipulations in JavaScript? I'm writing an prototype.js app (memonaut) that moves around DOM elements, enables editing and deletion of those elements. There are event-handlers and other objects associated with each element operated upon. Not...

Facebook Connect via Javascript doesn't close and doesn't pass session id

I'm trying to authenticate users via Facebook Connect using a custom Javascript button: <form> <input type="button" value="Connect with Facebook" onclick="window.open('http://www.facebook.com/login.php?api_key=XXXXX&amp;extern=1&amp;fbconnect=1&amp;req_perms=publish_stream,email&amp;return_session=0&amp;v=1.0&amp;next=http%3A%2F%2Fwww.e...

Rotating blocks in JavaScript.

I'd like to create a JavaScript web app that makes blocks appear on the page that can be dragged around by the user. If I used DIVs with background colors, it would be easy to rotate them by 90 degrees at a time. However, if I wanted to rotate them arbitrarily, how could I accomplish this? I'd rather not have to resort to Flash, images,...

jQuery UI: Two semicolons after logical expression with function wrapper

I was looking at some jQuery UI code, a found a weird behavior there: jQuery.ui||(function(a){ /*... */ })(jQuery);; The logical OR is clear for me, the function wrapper (still searching the correct name for it), too, but why two semicolons? Thanks in advance Vincent EDIT: Just found a another weird thing: In the version on google ...

How does this JavaScript/JQuery Syntax work: (function( window, undefined ) { })(window)?

Have you ever taken a look under the hood at the JQuery 1.4 source code and noticed how it's encapsulated in the following way: (function( window, undefined ) { //All the JQuery code here ... })(window); I've read an article on JavaScript Namespacing and another one called "An Important Pair of Parens," so I know some about wha...

Visual Studio 2010 insists on inserting spaces in JavaScript

Visual Studio 2010 inserts a space between the keyword "function" and the following parenthesis. Is it possible to turn this off? i.e. Visual Studio formats my code like: var vsfn = function () { }; I would like this formatting: var myfn = function() {}; ...

Javascript (and HTML rendering) engine without a GUI for automation?

Are there any libraries or frameworks that provide the functionality of a browser, but do not need to actually render physically onto the screen? I want to automate navigation on web pages (Mechanize does this, for example), but I want the full browser experience, including Javascript. Thus, I'd like to have a virtual browser of some so...

Using new Image().src for click tracking

I am attempting to figure out why this click tracker isn't working. The code was written by another developer so I am not entirely sure if this ever did work. function trackSponsor(o, p) { (new Image()).src = PATH_BASE + 'click/' + p + '/' + o + "?_cache=" + (+(new Date())); return false; } From what I can gather is that w...

How can I run a local Windows Application and have the output be piped into the Browser.

I have Windows Application (.EXE file is written in C and built with MS-Visual Studio), that outputs ASCII text to stdout. I’m looking to enhance the ASCII text to include limited HTML with a few links. I’d like to invoke this application (.EXE File) and take the output of that application and pipe it into a Browser. This is not a o...

Any way to pass parameters programmatically to an onclick function?

I have an onclick function which performs several tasks. In another javascript function I do not have access to the context variables needed to perform these tasks. To get around this I have been simply calling the onclick function directly. The problem I have now is that I'd like to perform a task after an Ajax action in the onclick ...

Variable is Undefined

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <HEAD> <script type="text/javascript" src="lb-core.js"></script> <script type="application/javascript"> var lbp = { defaults: { color: "blue" }, in...

Linking javascript BASEDIR

Hello. So continue from this: http://stackoverflow.com/questions/2715295/linking-how-php-html Please check the answer i accepted, and i used the "BASEDIR" solution zneak came with. Now i ran onto another problem.. in my ajax_framework.js i have: $.ajax({url: "session.php", success: function(data){ how should i include BASEDIR onto t...

Stop an executing recursive javascript function

Using jQuery, I've build an image/slide rotator. The basic setup is (in pseudocode): function setupUpSlide(SlideToStartWith){ var thisSlide = SlideToStartWith; ...set things up... fadeInSlide(thisSlide) } function fadeInSlide(thisSlide){ ...fade in this slide... fadeOutSlide(thisSlide) } function fadeOutSlide(this...

SO style alert header

I apologize if this question is vague, but I want to build a drop down header, very similar to the one on StackOverflow that alerts you whenever you have earned a new badge, or on Twitter whenever a new tweet comes in. I've been looking around on the internet for a tutorial, but I'm having trouble googling exactly what I'm looking for. ...

confirm box when link is clicked

<script type="text/javascript"> $("a.route").live('click', function() { // live is better $("#results").load( $(this).attr('href') ); return false; }); </script> thats the code, how can I incorporate the code you just gave me? ...

Why are javascripts sometimes surrounded by these tags?

Why are some JavaScripts encapsulated within these tags: <!--//--><![CDATA[//><!-- some js here //--><!]]> ...