jquery

Public (static) property in jQuery plugin

I've a small jQuery plugin that I use for form AJAX validation. There is a callback that alerts the calling script of every "stage" in the validation/submission process. Some snippets: (function ($) { $.fn.formHelper = function (options) { // settings options etc var stage = { Start: 1, ErrorReceived: 2, AllErrorsRe...

Dynamic table colspan

Hi there, I have worked for web project and I'm using jQuery for client side scripting issues. I have an ajax page and this page fully loading dynamically from inside of the javascript that is uses jquery. When the document ready, i'm creating three smilar table like these; Table A Hea A | Hea A | Hea C | Hea D Table B Col A | C...

Getting the OnClick event when enter is pressed (IE)

Hi everyone, I have the following code (inherited from someone): <div class="feedback">&nbsp;</div> <form onsubmit="return false" autocomplete="off"> Enter your guess: <input type="text" size="48" id="guessedword"/> <input type="submit" value="Guess!" id="guessbutton"/> </form> </div> Now, I want to do someth...

Replacing special chars from the output

searchVersion: function (dataString) { var index = dataString.indexOf(this.versionSearchString); if (index == - 1) return; return parseFloat(dataString.substring(index + this.versionSearchString.length + 1)); } ... returns browser version, in my case, its "3.6". Since I'm going to use this as a class name, I want to remove ...

Concatenation in jQuery

var os = $.client.os; // mac var browser = $.client.browser; // firefox var browserversion = $.client.browserversion; // 3 $('#root').addClass( os + browser + browserversion ); .. results in <div id="root" class="macfirefox3">. How do I add spaces between them? ...

jQuery DatePicker - How to highlight certain days every month?

Hi I have a jquery datepicker which is renders the current date by default as a full calendar. Before this is rendered I get a list of days from the server via ajax of days that need to be highlighted for the current month. The code for this is as follows: $.get("Note/GetActionDates/?orgID=" + orgID + "&month=" + month +"&year=" + yea...

preventing the page from responding to pageup/pagedown events for page scrolling

Hi All, I am using jquery in one of my projects. I have a scenario where I have to add keyboard events to the td cells of a table to move up and down in them. I was able to achieve this using the following code. Here is my code: <script type="text/javascript"> var tds = jQuery("#myTable td"); tds.bind('keyup', function(event){ ...

how to add a color to a line in sharepoint 2007 list that has a specific text ?

hello there, I would like to know how to add a color to a line in sharepoint 2007 list if in one field there is a specific text contained ? for example : I have a list that have three fields: list1 1.id 2.name 3.full description now i want to show only the first and the second field to the user. list1 id name 1 abc 2 edv s...

how to drag a 'div' element to the google maps ,that be changed to a 'marker'..use jquery

this is my code : <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml" > <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="viewport" content="width=device-width,minimum-scale...

JQuery Timer for Matches

I would like to bulid a Timer (with minutes from 1 - 90 with start and stop)for a soccer match of my local team. How could i do that with JQuery? any ideas? i couldnt find anything related. thank u ...

how to make a element draggable use jquery ??

<div id=b style="width: 50px; height: 50px;background:red;margin-left:300px;"></div> <script src="jquery-1.4.2.js" type="text/javascript"></script> thanks ...

Call function on div click

Hello I am doing this: <div onclick='alert("xxx")'>Click me!</div> and i see that alert but i want to call on function inside that onclick. I'm trying this but it doesn't work. function GetContent(prm){ alert(prm); } <div onclick='GetContent("xxx")'>Click me!</div> I need to call that function inline not assign an id or cla...

find the relative element with jquery

Is there a simple and clean jQUery-way to find the element who a element is having it's relative position to? In other words: finding the first parent who has the css attribute position: relative, or the body-element (if no parent elements has position: relative). I do -not- know the css-class or whatsover of the parent. ...

Prevent ASP.net __doPostback() from jQuery submit() within UpdatePanel

I'm trying to stop postback on form submit if my custom jQuery validation returns false. Is there any way to prevent the __doPostback() function finishing from within the submit() function? I'd assumed: $('#aspnetForm').submit(function () { return false; }); would do the trick, but apparently that's not the case: does anyone have a ...

JavaScript suppress double click selection

Hi Guys, i'm working on a slide gallery at the moment. My problem is that when i click the navigation divs very fast, the browsers default behavior is fired (selection of content). My question is: how can I suppress the default double click behavior? navigationDiv.onclick = function () { // do something }; A jQuery solution would ...

Copy and manipulate ALT on Image

Hi there I'm a new visitor, and relativily new at jQuery. I have an image with an ALT text that I would like to be shown, in the SPAN, under the image, and manipulated to replace "-" with B- and I-tags... Current HTML: <span class="alignright"> <img src="sys/billeder/medarbejdere/tommy_stor.jpg" width="162" height="219" title="N...

How do I make JQuery append work in IE 7 and 8?

This is my code: $("#multimedia-tabs #"+response.currenttab+" #"+response.currenttab+"div").append(divHtml); Where divHtml has the html li tags It works fine in FF and chrome but not in IE7 and 8 :( Tried many alternatives available on this site but no joy! Please help $(document).ready(function() { $("#next").live('click', f...

How to identify if an ` <a>` has been visited or not in jquery

Hi All, Want to know , How to identify if an <a> has been visited or not in jquery. i.e. if(`<a> has been visited`) { //execute this code } else { //execute that code } ...

javascript/jquery remove or delete option from select

I need to delete an option from a select in certain circumstances. Basically: if(mystatement == true) { //remove item with id 'option1' from select of id 'select1' } Anyone know the code for me to achieve this? Many thanks. ...

RJS code returned doesn't execute

I am using jQuery with rails. I am trying to make a PUT request to update a task. The call is made successfully. However, the javascript code returned does not execute. The code is returned alright but it just does not execute. Here is the jQuery put request i am making. $("#droppable_<%= bin.id -%>").droppable({ drop: function(e...