javascript

iphone's safari touchmove event not working.

i am using jquery and touchmove event but the code is not showing anything in #info $('#movieShow').bind('touchmove',function(e){ e.preventDefault(); $('#info').text(e.touches[0].pageX); }); ...

Regular expression for Character only a-z, A-Z

I dont know how to create regular expression in javascript or Jquery I want to create a regular expression that will check if string contains only characters between a-z and A-Z with any arrangement EDIT When I tried to make regex /^[a-zA-Z\s]+$/ to accept white spaces as well. It is not working. What could be the mistake. I am t...

Javascript matching to see if an email or phone number has been supplied

I created a contact form with a text area input only field, which allows the end user to fill out and include a method on how to be contacted. They can choose to enter an email, phone number or both within their message. I am using jQuery along with javascript to process the form and check if a contact method has been inputted into the ...

Printing API-Generated Google Maps from Internet Explorer

Hello, Having an odd problem printing an API-generated (V3) Google Map from Internet Explorer 7 & 8. I generate my map with JavaScript similar to the following: <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"&gt;&lt;/script&gt; <script type="text/javascript"> function initialize() { var centroi...

jquery ctrl+enter as enter in text area

Hello All, I am trying to reproduce standard instant messenger behavior on TEXT area control: enter works as send button. ctrl+enter as real enter. $("#txtChatMessage").keydown(MessageTextOnKeyEnter); function MessageTextOnKeyEnter(e) { if (!e.ctrlKey && e.keyCode == 13) { SendMessage(); return false; } ...

jQuery dataTables plugin - how to ignore word from column sort

I have a table of books with titles, authors, publishers, and dates in it. Under the title column a lot of the book titles start with the word "The." How can I setup the sort within the jquery datatables plugin to ignore the first word if it is "The" when sorting this column? Thanks. ...

Get value of asp:textbox with javascript .net 4 framework

I thought I heard that in .net 4 we would be able to reference asp:textbox's by id and not have to use clientid to get the value. I can't find this documented anywhere. Just wondering if anyone knows if this works and what the syntax is? ...

jquery calendar issue

I have a start and stop textbox field which triggers jquery calendar. I want to know whether it is possible to achieve when I select a date on the start, will populate the same on the stop? ...

Compare text input's value against default value

For a text input defined as: <input type="text" name="Email0" id="Email0" value="1st Email" /><br /> If the user changes the value of that text box I simply pass it along with the form submit...if they _haven't changed it - i need to pass a value of 'null'. $('#frmSignup').submit(function () { if (Email0.value != Email0.defaultVa...

How to make accordion menu close and open sequentially rather than simultaneously?

I've got a jQuery plug-in to generate accordion-like menus. However, my slideUp() and slideDown() functions seem to be happening simultaneously. Ideally, I would like all expanded sub-menus to slide up, and then the selected menu item's sub-menu slide down once that's completed. My code is as follows: jQuery.fn.accordionMenu = function...

Regular Expression that is Eval'ed with Word Boundaries

I'm trying to create a bad word filter that throws out tweets that contain any of the words in a provided list, case insensitive. Only problem is that I want to do a simple encoding of the bad word list so that bad words are not downloaded to the client browser. I think the only way I can do it is by eval'ing a regular expression. Only t...

Google Maps API v3 : Click events not triggered in firefox for custom marker

Hello, have created a map that I'm trying to have function similar to 'My Maps'. I have two dropdownlists on the right side, based on the selection in those ddl's, you can add a custom marker / icon. You select a marker type, then click the '+' button in the top right corner of the map, and then click where you want the marker added. My ...

JavaScript: Access between two functions defined in global scope.

Hi there, can anyone explain the following to me. I have two JavaScript functions defined in global scope as follows: var foo = function () { var that = this; that.toString = function () { return "foobar" }; return that; }(); alert(foo.toString()); var foo2 = function (foo) { var that;...

Loop through all checkboxes that are inside a div tag

I need to loop through all checkboxes that are inside a div tag with id #abc123 How can I do this? $("#abc123").foreach( ???? ) Update my html row looks like: <tr> <td><input .../> </td> <td>234</td> </tr> I need to add the value of the <td> into the ID of the checkbox. Would I just get the parent, then ancestor it somehow? ...

How do I recognize a mouseclick in a webpage from a Safari extension?

I'm a bit of a noob, but I tried all of the obvious things. Perhaps my javascript is just terrible and that's why, but onmousedown = func; doesn't work. etc. function performCommand(event) { /*removed*/ //It reaches this point document.body.onclick = function() { //Never reaches this point /*removed*/ } } ...

Display a counter variable with JS

I have a rotating slide show I'm working on that uses Javascript. I use a counter in the function, and I want to display the value of the counter each time the image changes. (so it will say "viewing i of x pictures") I tried using <script language="javascript" type="text/javascript">document.write(i);</script> but it only displays ...

JavaScript, HTML - Is it possible to show value Html.TextAreaFor in Javascript ConfirmBox?

Hello all, I'm trying to show Value of Html.TextAreaFor in Javascript Confirm Box but my code doesn't work. Maybe somebody has a good idea how to fix it.. This is my code: <% using (Html.BeginForm()) { %> <%= Html.Hidden("ThreadId", Html.Encode(this.Model.ThreadId))%> <%= Html.TextAreaFor(m=>m.Quote,7,40,nu...

Jquery: how to: when UL is shown, have first LI animate 'left' 20px, then to 0px, then have the second LI do that, then third, etc.

When UL.chapters is 'slideDown', have the first 'chapters LI' animate the 'left' property to 20px, then animate back to 0px, then have the second LI do the same thing, then have the third, and so-on. with my code, they all animate directly after UL.chapters slides down, how do I make them do their animation 1 at a time, with the second n...

ExternalInterface w/External FLV Player

I am curious if anyone knows of a way I can set my .SWF external FLV player to call a JavaScript function once the flv is ready/buffered for playback? Everything I have tried thus far has not worked...Any help would be greatly appreciated! ...

Is there anyway to have multi line spanning string without using +

I have a large html string that I am populating with data and using in an innerHTML... I want to make a string like this: var str = '<div> <div></div> </div>'; Instead of like this: var str = '<div>' +'<div></div>' +'</div>'; Is there a way? ...