javascript

Cufon gives double line height without control

Cufonning a font onto a page with a Cycle jQuery plugin enabled, slowly scrolling through a set of messages. Each message moves off the viewport but then takes forever for the next one to appear. There is almost a one second gap between the first one leaving and the second one appearing. Any reason why this is happening? Here's my code:...

Is there an SVG Map library like Google Charts?

I'm looking for large-scale world maps that I can shade by country. Google Charts has an API for this but it only allows you to generate a small map (440x220 px). Does anyone know of a way to generate such maps with an open-source library? ...

How do I use Javascript to get the name of the UserControl it is called from?

I am trying to replace postbacks with javascript client side processing whenever I can in my aspnet c# 3.5 code so as to improve the user experience. I am not using any javascript frameworks. I am using vs2008. I have a usercontrol .ascx file with a dropdown list and button which is used in three places on my main screen. I had bee...

Is it possible to position ValidatorCalloutExtender dynamically?

I have two ajax validator callout extenders that are programmed via VB.net.I am validating one textbox but I want the popup to appear next to a different textbox. How can I tell the ajax popup where to appear? Dim custval As New CustomValidator custval.ID = "ValidPage" custval.ErrorMessage = "<font color=red>Please Enter a '...

What ways can I put a FAVICON into my site?

I was looking around the web at the way different sites put their favicon into the site. Whenever I try to do it myself I end up "hacking" until it just suddenly decides to work. I suppose I have 2 questions in one here. How is this site adding it's favicon? - http://www.fbd.ie I can't find favicon.ico in it's page source. Apart from...

How to disable Draggables in script.aculo.us

Hi- I'm trying to make a group of objects draggable as you can see below - easy enough. But I'd like to configure things so that if any one of these items gets dragged, the others automatically cease to be draggable. Does anyone know how to do this? var products = document.getElementsByClassName('box'); for (var i = 0; i < products.le...

Javascript, variable reference

In a situation like the code below how would you go about accessing a variable value that is in an anonymous function? I would like to return the bool value of filterData(xmlhttp.responseText, thisForm); which will be boolean to the main checkAvailable function. Thanks in advance. function checkAvailable(thisForm) { var xmlhttp = h...

Is there access to the iPhone accelerometer using Javascript?

I'm starting to try and do some web based game programming for my iPhone, and other web enabled phones that my friends have, and was having a hard time finding information on accessing the accelerometer using Javascript in the browser. With the latest release, I know I've got access to location information now but I was hoping that I c...

[JQUERY] Help me with my selector, the ID is dynamically changing every page load.

Hi, I want to scan a website using jQuery, but the ID is constantly changing, but there's a permanent pattern for the ID that I'm searching for: app7019261521_the_coinb4678bc2 app7019261521_the_coind42fgr23 app7019261521_the_coing0992gvb app7019261521_the_coin12e5d0aa The IDs always starts with app7019261521_the_coin But my problem i...

jQuery: issue with live events, a form and the back button

Hi, I have build a quite complex widget which contains "some kind of form". It has a form tag, but I'm loading a lot of stuff in there via Ajax etc. Cannot explain it in detail, and the code is too long to paste in here. Now, in a "live('click', function()" I use for one of the form fields, I'm writing a couple of values into hidden fi...

passing \n into javascript

hi, I have a javascript function that takes in a parameter that is given by a php session. This works well except when the value is from a text area that contains a newline character. I guess it appears as if I'm passing in a parameter and then the newline indicates I have stopped or something like that. Please advise on how to fix this...

Form Validation using javascript

Hey Guys, The validation code that i have on my page is: function validateForm() { with (document.contactform) { var alertMsg = "The following REQUIRED fields\nhave been left empty:\n"; if (name.value == "") alertMsg += "\nName"; if (email.value == "") alertMsg += "\nEmail"; if (message.value == "") ...

Given a textarea generated from asp:textbox, the inner text cannot be 'set' with Javascript or Jquery

I have a single asp:textbox declared as follows: <asp:TextBox ID="textBox1" class="myTB" runat="server" TextMode="MultiLine" Font-Names="Calibri" Font-Size="Small" Font-Bold="True" Height="175px" Width="725px" BorderColor="#76B900" BorderStyle="Solid" BorderWidth="2px" Style="overflow: hidden; margin: 5px;"></asp:TextBox> Rendered ...

using a variable in :contains - how to

I am using accordion menu on an e-commerce site. The menu stays open with the options until the product page. On that page I am trying to use the breadcrumbs to match text in the menu and then apply a class to open the menu to the correct category for the page. Here is my code: $(document).ready(function(){ var bctext = $('#ProductBre...

How can I determine a timezone by the UTC offset?

I have a scenario where I have a timezone offset (in minutes) and need to determine the timezone for it. I know that all the data is not available (for example, there may be several timezones with an offset of -240 minutes) but a "best guess" is acceptable. My first pass looked like this: foreach (var info in TimeZoneInfo.GetSystemTim...

Tracking AJAX-based forms with Google Analytics Goals

I'm developing sites using a content management system, features are added via 3rd party modules which is much easier for designers like myself. However, I'm a bit perplexed at the moment. I have an AJAX-based contact form, so there is no page-load upon submission. However, I do have access to HTML templates for each step (Input page, F...

Changing the colour of a dropdown list when closed

With CSS I can set font and background colours for the individual options of a dropdown "select" list; however, these colours only show up in the actual dropdown. The colours shown in the box on the page when the list is not open are still the defaults. Currently I have a list with many dropdown boxes having a few options, and it would ...

Javascript Arrays - removing array Elements

Hi, I have the following array setup, i,e: var myArray = new Array(); Using this array, I am creating a breadcrumb menu dynamically as the user adds more menu items. I am also allowing them to removing specific breadcrumb menu items by clicking on the cross alongside eatch breadcrumb menu item. Array may hold the following data: my...

Accessing CSS classes in a css file, cross-domain, in javascript

We include the CSS file via standard HTML STYLE tag. Then we need the javascript code to access the CSS classes and attributes. in IE and Chrome all goes fine, but in Firefox it throws this exception: uncaught exception: Security error (NS ERROR DOM SECURITY ERR) here's the javascript code: for (var i = 0; i != window.document.styleS...

Is there an easy way to convert HTML with multiple <br/> tags into proper surrounding <p> tags in Javascript?

Let's say I have a bunch of HTML like below: bla bla bla long paragraph here <br/> <br/> bla bla bla more paragraph text <br/> <br/> Is there an easy way with Javascript to convert it to properly semantic <p> tags? E.g.: <p> bla bla bla long paragraph here </p> <p> bla bla bla more paragraph text </p> Output spacing is not impo...