jquery

Adding element to node

There's a HTML: <div class="test"> <ul> <li>Item 1</li> <li>Item 2</li> </ul> </div> And a bit of JS: $(document).ready(function() { // do stuff when DOM is ready $(".test ul").append('<li>Dupa</li>'); }); Why does it add nothing, but if I remove html from append's argument string, .append('Dupa') it works - but ...

Jquery how to get attribute from a HttpServletRequest

Hello all: I have this piece of code: $("#faq").click(function () { var url = $.get("faq", { pagina: "page" }); alert(url); }); On "faq" responds to a Servlet that sets an attribute on the request .... request.setAttribute("pageFAQ", pageFAQ); .... After the get jqeury prints [object XmlHttpRequest]. I would lik...

jQuery plugin for pre-populating form text inputs

I know this plugin exists because I've seen it some time ago. It has the functionality to pre-populate given form text fields with text if they are empty when they lose focus, but the text disappears if focus enters the field or the form get submitted. This functionality can be seen on www.pownce.com. Does anyone have an idea where I can...

How can I get a DIV to centre on a page using jQuery and blockUI?

Hi All, I'm trying to convert Matt Berseth's 'YUI Style Yes/No Confirm Dialog' so I can use it with the jQuery blockUI plugin. I have to admit I'm no CSS guru but I thought this would pretty easy even for me....except 10hrs later I'm at a loss as to why I can't get the blasted thing to work. The problem is that I can't seem to get th...

How do I set a textbox's value using an anchor with jQuery?

I have a textbox whose value I want to set based on the inner text of an anchor tag. In other words, when someone clicks on this anchor: <a href="javascript:void();" class="clickable">Blah</a> I want my textbox to populate with the text "Blah". Here is the code I am currently using: <script type="text/javascript"> $(document).r...

How can I achieve uploading same files as a batch using jQuery?

When uploading some image/audio/video files in the same batch I want the file selected in the one field should not get accepted in the other buttons. How can I achieve this? ...

Trying To Show A DIV In jQuery

I have this java code: <script src="http://www.google.com/jsapi"&gt;&lt;/script&gt; <script type="text/javascript"> google.load("jquery", "1.2.6"); $("a#more").click(function() { $("#info_box").show("blind", { direction: "vertical" }, 800); }); </script> And this link: <a href="#" id="more">More Info...</a> info_box is just a di...

Run time used by JQuery

hi, Is it correct to assume that JQuery is not actually an implementation of ECMA spec but rather some kind of framework? If that is true, what run time does it use? For example in IE, does it finally end up with the javascript engine in IE? thanks Sesh ...

What's the best non-WYSIWYG textarea editor?

Hi, I'm trying to find an editor (or some simple JavaScript - preferably jQuery) that will allow me to edit the contents of a textarea. I don't want it to be rich text or WYSIWYG; I just want to be able to select a bit of text, click a button/link and have some simple HTML tags that I define put either side of the highlighted text. I a...

Best way to pass an array from JavaScript to C#?

I need to pass an array from JavaScript to a page method in C#. I have tried using a parameter in the C# method of IList and also a string[] array. Both ways throw an exception "cannot convert an object of type system.string to xxx", where xxx is the parameter type in the C# method. I am passing the object from jQuery as a json object, a...

Refresh table info using jQuery and ASP.NET MVC

I have a simple page that displays a user's email addresses in a table. I also have a textbox underneath the table and an "add" button. Currently, I am using a simple form post that is handled by a controller that will add the e-mail address to the database and reload the page. This works fine, but I'm looking to streamline the proces...

"Stop running this script?" error

I am developing a site that makes extensive use of JavaScript (jQuery). I regularly get the IE 'Stop running this script?' error dialog when I try to close the browser. I'm guessing the problem occurs because the site is a single page that uses AJAX, so there are no postbacks to reset IE's count of commands executed. Client-side regis...

JQuery - Slider Tutorials

Does anyone know of some good tutorials that explain how to use the JQuery Slider. I've found a few, but none of them really present what I need in clear terms. What I really need to figure out how to do is make the slider go from 1.0 - 5.0 (including all tenths) and when it changes set a hidden control based on that value. Thanks. ...

JQuery Slider not passing tenths value

I have a JQuery slider that's working pretty well, but for some reason it's not passing the tenths value. $(document).ready(function(){ $("#scoreSlider").slider({ 'steps': 40, 'min': 1.0, 'max': 5.0, 'startValue': 3, 'slide': function(e, ui){ document.getElementById('div_score').innerHTML = u...

Capturing Print Event via jQuery

I would like to be able to manipulate the DOM just before my page is sent to be printed. Internet Explorer has an event on the window object called "onbeforeprint" but this is proprietary and isn't supported by other browsers. Is it possible to do this via javascript (jQuery in particular, if possible)? Before you ask, I can't easily us...

jquery validate form input if certain check boxes are checked

I have a multipart form that takes basic user information at the beginning with some jquery.validate error checking to see if the fields have been filled in and the email address is valid. Below that there is a series of check boxes (type_of_request) for new accounts, delete accounts, new software etc which show/hide those form elements...

Does jQuery's $.ajax() function handle ASP.NET authentication correctly?

I have a web app protected by ASP.NET Forms Authentication. The site uses jQuery's $.ajax() functionality to call a web service in the same app. Browsing to the web service .asmx does cause forms authentication to kick in and I once authenticated and make a $.ajax() call to the server I also see the ASP.NET session cookie and forms aut...

How can you check for a #hash in a URL using JavaScript?

Hi, I have some jQuery JavaScript code that I want to run only when there is a hash (#) anchor link in a URL. How can you check for this character using JavaScript? I need a simple catch-all test that would detect URLs like these: example.com/page.html#anchor example.com/page.html#anotheranchor Basically something along the lines of...

ASP.Net MVC Ajax form with jQuery validation

I have an MVC view with a form built with the Ajax.BeginForm() helper method, and I'm trying to validate user input with the jQuery Validation plugin. I get the plugin to highlight the inputs with invalid input data, but despite the invalid input the form is posted to the server. How do I stop this, and make sure that the data is only p...

How do I select text nodes with jQuery?

I would like to get all descendant text nodes of an element, as a jQuery collection. What is the best way to do that? ...