javascript

Text with gradient and custom font

Ok here is my challenge, I have some <h1> tags that I want to convert into a custom font and apply a gradient from left to right. Initially I was going for the idea of using cufon as this does both, but it turns out cufon only supports top to bottom gradients. My only other option as far as I am aware is sIFR which I believe may suppor...

Error: Sys.InvalidOperationException: Type AjaxControlToolkit.BoxSide has already been registered

Hi friends getting the error Error: Sys.InvalidOperationException: Type AjaxControlToolkit.BoxSide has already been registered while running the web site. Don't know due to this some javascript files are not working. Can any one help me. ...

Unterminated Parenthetical error with a Regular Expression in Javascript

I am trying to use the following regular expression to validate a date in javascript (sorry it's a bit of a brute): "/^(((0[1-9]|[12][0-9]|3[01])\/(0[13578]|1[02])\/((19|[2-9][0-9])[0-9]{2}))|((0[1-9]|[12][0-9]|30)\/(0[13456789]|1[012])\/((19|[2-9][0-9])[0-9]{2}))|((0[1-9]|1[0-9]|2[0-8])\/02\/((19|[2-9][0-9])[0-9]{2}))|(29\/02\/((1[6-9]...

Is there a Javascript or jQuery event that triggers on following a focused link with the keyboard?

I'm using jQuery focus() and blur() to highlight image links during keyboard navigation (tabbing) but need to be able to run some code when a link is followed via 'Enter' on the keyboard. Is there a built in event which does this or do I need do something like bind keypress and check for the 'Enter' key? ...

web apps Ipad : how to prevent keyboard from popping on textbox focus/click

I am trying to create a custom keyboard on an Ipad application. But each time the input get the focus, the native Ipad keyboard pops up... How can I prevent this, in javascript. Thanks for your answers. Kevin ...

Javascript Namespace declaration

What is the proper way to declare a namespace? I've just read "Developing Large Web Applications" and the author suggests using: if (!window.YourNamespace) { YourNamespace = {}; } seems easy enough.. but I see all the javascript libraries for declaring namespaces and alternate methods. Isn't there a standard way to do this? Any ...

Google Maps don't fully load

I have a somewhat strange problem. I have two maps on my site, a big one and a small one. I want to use the big one to show a route to a certain address. I'm now trying to implement the two maps but get a weird problem. The small map is working fine, but on the big map only a small area of the div is filled with the map, the rest is empt...

Hitting "enter" from an input (text) field when a form has a "submit" input

I'm trying to figure out something having to do with the behavior descibed by this old question from last year. I've got a form with a single input text field, and a single "submit" button. Unlike the person who asked that question, I want the form to submit when the user hits "enter". Indeed, that's working for me; what's not working ho...

determining the height of an element

After setting the height of some element (say a div) to auto, still can I get the height of this div in pixel or may be in some other units ...

mootools / class / objectinstance doesn't work

Hey. I have no idea why i get a 'b' and not an 'a' when i call a.get(). Can someone help me? var tclass = new Class({ initialize:function(n){ this.options = Object.extend({'name' : n}); }, get:function(){ return this.options.name; } }); a = new tclass('a'); b = new tclass('b'); a.get() // b ...

Javascript function argument handling

It seems the best way to deal with arguments in javascript functions is to require the caller to pass an associative array: example = function(options) { alert('option1: ' + options.a + ', option2: ' + options.b); } Now arguments are named and not needed in any particular order when calling this function: example({'b':'hello option...

ajax file upload

hii i am using ajax file upload in this code <script type="text/javascript" src="fileuploader.js"></script> <script type="text/javascript" src="jquery-1.4.2.min.js"></script> <div id="photo_upload"> <div id="file-uploader_photo"> <noscript> <p>Please enable JavaScript to use file uploader.</p> ...

[Javascript]Regex Expression

Hi, I have this string: Tue,Sep,21,15:48:1,CEST,2010 I would replace the "," with a space. I have tried: string=string.replace("/,/g"," "); and the result is: Tue,Sep,21,15:48:1,CEST,2010 I have tried: string=string.replace(","," "); and the result is: Tue Sep,21,15:48:1,CEST,2010 How can I replace all the "," with " "? ...

how to set contentplace holder size that support all browser...

Hi, I have used clientheight for getting height.When i use in ie its working fine.But in the case of other browser its not working.How can i set contentplace holder.i have tried with window.height()..but its not working ...

How to set background-position-x with IE

I'm tired of setting background-position-x with IE, $('.scroller').css('background-position-x', posX+'px'); is not woking, any other methods var posX = $('.scroller').css('background-position'); if(typeof(posX) === 'undefined') { posX = $(' .scroller').css('background-position-x'); } posX = posX.split(" ",1); ...

JavaScript: Why do document.write failed with 'no privilige'?

<html> <head> <style type="text/css"> #navigator a { display: none; } </style> <script type="text/javascript"> function view() { var a = document.getElementsByTagName("a"); for (var i = 0; i < a.length; i++) alert(a[i].innerHTML); for (var i = 0; i < a.length; i++) document.write(a[i].innerHTML...

Unescape JavaScript's escape() using C#

Are the any functions in C# that handle escape/unescape like JavaScript? I have a JSON string like this: {"Feeds":[{"Url":"www.test.com","FeedType":"Twitter"},{"Url":"www.test2.com","FeedType":"Youtube"}]} Which looks like this after escape() %7B%22Feeds%22%3A%5B%7B%22Url%22%3A%22www.test.com%22%2C%22FeedType%22%3A%22Twitter%22%7D%2C...

jQuery window resizing

$(document).ready(function(){ WinSize = $(window).width(); var currentPosition = 0; var slideWidth = WinSize; $(function(){ $(window).resize(function(){ slideWidth = WinSize = $(window).width(); }); }); var slides = $('.slide'); var numberOfSlides = slides.length; // Remove scrollbar in JS $('#slidesContainer'...

How to I get the value of a radio button with javascript

I need to obtain the value of a radio button using javascript I have a radio group called selection <input type="radio" name="selection" id="selection" value="allClients" checked="checked" />All Clients<br /> <input type="radio" name="selection" id="selection1" value="dateRange" />Date Range between I pass the value to an...

How to retrieve the display property of a DOM element?

<html> <style type="text/css"> a { display: none; } </style> <body> <p id="p"> a paragraph </p> <a href="http://www.google.com" id="a">google</a> </body> <script type="text/javascript"> var a = (document.getElementById('a')).style; alert(a.display); v...