jquery

how to show text while typing in textarea in jquery

hey guys i looking for a way to preview the text while im typing in a textarea in jquery exactly what u are using for Stackoverflow , ...

How do I get element's className inside loop of elements?

I am trying to create a function that given a divid, and a list of classes, will then do some text replacing inside them. Having learned of how Firefox Dom is handling text nodes differently, I read that I had to use javascript to loop through the elements, sibling to nextSibling. The last obstacle I had in my script, of which you see...

Jquery - check if atleast one checkbox is checked

All, I have the following HTML form and it can have many checkboxes. When the submit button is clicked, I want the user to get a javascript alert to check atleast one checkbox if none are checked. Is there an easy way to do this using Jquery? <form name = "frmTest" id="frmTest"> <input type="checkbox" value="true" checked="true" name="...

jquery click tracking is acting a little strage

On some links on my HTML page I have a special CSS class, that when clicked, I make a ajax call to a click.aspx page and track the click. <a href="..." class="click" id="blah-1">blah-1</a> $(".click").bind("click", function() { $.get("/click.aspx?&source=" + $(this).attr("id")); }); So what is happening is the value of s...

Changing Button Attributes to Match Slider Window

Greets, First - this site is incredible. I've learned a ton of great things here! I'm using a jquery based slider program to display a sequence of pictures (a series of books). Beneath the slider window I've positioned a "PDF" buttons. I'm trying to sort how to have the button download the file associated with whatever image is curren...

matching an element's class to another element's ID, or *part* of another element's ID

hello again Such a simple concept but I'm struggling to express it ... apologies in advance for my verbosity. I have a container div with a class, e.g., ; I want to use that class to do two things: add a class (e.g., 'active') to the nav element whose ID matches the class of div#container (e.g., #nav-primary li# apples) add the same...

Saving dynamically added text input to MySQL.

Hey all, using this method http://stackoverflow.com/questions/1501181/jquery-append-and-remove-element i'm adding text inputs to a document. i'm using this php if($_POST['cp_slider']) { $array=$_POST['cp_slider']; foreach($array as $cp_slider) { if(strlen($cp_slider)>0){ echo '<li><input type="text" name="cp_slider[]" value="'.$this->op...

How to style content in jQuery Facebox

I'm using jQuery Facebox plugin to create some modal windows. One situation is to display errors that might occur. If JS is disabled, I do this by displaying any errors in a normal div that is styled by CSS using a class selector. If the user does have JS enabled however, that div is hidden and the info is displayed in a facebox. The pro...

jQuery Adding DOM Elements

This may be a simple answer, but I'm trying to add a dom-created element (i.e. document.createElement(...)) to a jQuery Selector. jQuery has a great assortment of functions for adding html .html(htmlString) .append(htmlString) .prepend(htmlString) But what i want to do is add a dom OBJECT var myFancyDiv = document.createElement("di...

jQuery live() and stopPropagation() issue

I know that the live() event handles event bubbling different than all other jQuery events. jQuery recommends using 'return false', but in my case that doesn't work. The issue is: I have a DIV which contains an anchor tag. The DIV is bound using live(). Whenever I click the anchor tag inside this DIV it bubbles and calls the DIV's e...

How can I [simply] consume JSON Data in a Line of Business Web Application

I usually use JSON with jQuery to just return a string with html. However, I want to start to use Javascript objects in my code. What's the simplest way to get started using json objects on my page? Here's a sample Ajax call ( after $(document).ready( { ... }) of course: $('#btn').click(function(event) { event.preventDefault();...

Replacing browser http authentication forms

Hello, I am trying to replace the default login slip which drops down when the user tries to access a page which needs HTTP Digest authentication. I'm trying to achieve this with jQuery. Below is a snippet of my code: $.ajax({ url: url, method:'GET', async:false, beforeSend:function(req) { req.setRequestHeader...

Colorbox - removing the close button from a specific window

Hi, I'm using the colorbox plugin to display messages on my web page. One of them is a "wait for response" message, and I don't want the user closing it by himself. I know how to unbind the ESC key, and to disable the overlay close, but I still have a problem with the close button. I found I could remove it in the css like this: #cboxCl...

Is there a way to disable all other Java Scripts other than my own with Grease Monkey

I need help getting a Grease Monkey with JQuery Script to run on a broken site. I'm trying to get the following GM script to run, but the page I want it to work on has a JS error and my JS does not get executed. // ==UserScript== // @name BILL INFO PAGE ALTER // @namespace http://jenkinslaw.org // @description Alter the ...

Load external css file like scripts in jquery which is compatible in ie also

Is there a way to load external CSS files, like we load JS file by using .getScript method and also use the callback function like in .getScript $("<link/>", { rel: "stylesheet", type: "text/css", href: "/styles/yourcss.css" }).appendTo("head"); This Works in FireFox and similar but not in IE. ...

How to call JQuery functions

Hello, I was wondering about the different ways of using a JQuery function on a variable like I know this one $.DoThis(variable); but is there a way to call it at the end like normal Javascript functions variable.$.DoThis(); haha I know this sounds stupid but I need to ask somewhere. Thanks! ...

JavaScript - modal window with given html

Hi guys, how can I open a modal window using javascript only. I can't use own html-file so I have to pass html-data directly to method which will show window. Could you help me with this? upd: I can't use any own library. ...

How to do a jquery callback when a google maps marker is clicked?

I'm placing a number of markers on a map. When the user clicks on one of them, I'd like to do a callback to get some information, and display it in the popup. My code to place the markers on the map works, and looks like: GEvent.addListener(marker, "click", function() { html = getDetails(id); marker.openInfoWindowHtml(html); }); ...

jQuery check if element have css attribute

I need to know when I click on an element if this element have a css option. I am thinking at something like this but it does not work: if ($('#element').attr("text-shadow")) { alert ('i Have') } else { alert ('i dont') } Any tips on this one? Thanx ...

How do I change the cursor during a jQuery synchronous browser blocking POST?

$.ajax({ url: "/cgi-bin/stats.exe", method: "post", async: false, data: { refresh: "a41" } }); Using ajax post synchronously - "async: false". While it blocks the browser during the active request, what is the most efficient way to change the cursor to the hourglass or display a wait .gif? Perhaps ...