jquery

Grab the ID of a SPAN tag and add some value to a Text Box Field according to which tag has been clicked

Hi all, I was trying to grab the ID of the SPAN tag when a user clicked it. Since the ID of each tag contains two digits, they would be used for referring to the value of their corresponding hidden text box field, but I am stuck over this question. Here is part of the code that I have written. I need your help to finish it because I do...

How do I pass the this element to the result of getJSON?

I want to do the following... $('.showcomments').click(function() { $(this).parent().hide(); jQuery.getJSON('comments.json',function($data) { $(this).parent().append($data['value']) //this is meant to be the instance of //$('.showcomments') that has be...

ASP.NET Update Panel vs. jQuery AJAX

Is there a significant difference in performance between the two for relatively small post-backs? I'm taking in user input on a website, calculating some values from it and the returning it. Adding AJAX with update panel was really really quick obviously, but I'm wondering if I should just use jQuery instead. Also, how to the two metho...

Change CSS of selected text using Javascript

I'm trying to make a javascript bookmarklet that will act as a highlighter, changing the background of selected text on a webpage to yellow when the bookmarklet is pressed. I'm using the following code to get the selected text, and it works fine, returning the correct string function getSelText() { var SelText = ''; if (window.getSelec...

jquery ui button error

Why does this code (taken from the demo sample at jquery ui), doesn't work for me? It says .button() is not a function. Update: Tried loading from google no luck. Here is teh error $(".demo button:first").button is not a function Line 27 http://pastie.org/1039784 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html>...

ASP.NET MVC 2 AJAX vs. jQuery

What better to use in ASP.NET MVC 2: - Ajax-forms created with the AjaxHelper class or - jQuery ajax? I think it's a little more straightforward to use the AjaxHelper, but I don't know if it's a good practice to have many forms on the page (AjaxHelper creates a form, whereas the jquery doesn't). ...

fullcalendar, how to call month method?

Hello, I'm using fullcalendar. And i want to change my calendar, so the default month is June (the initial month for loading), I believe this is what I need: http://arshaw.com/fullcalendar/docs/current_date/month/ The problem is, I'm not very good at .js... and the explanation isn't very clear. This is what i tried: <script type='te...

jQuery .ajax call shows success when computer disconnects. How to induce ajax error state?

I have the following bog standard jQuery ajax request. I've been trying to induce an error state by disconnecting my computer from the network mid-request (the server takes 10 seconds to reply so this is simple). When I disconnect alert('Success: '+ json); is called, with null for the response json. I would expect the error part to be ...

how to send table value to printer ?

I want to send table values to printer.That table contails more than 50 records.so there is scrollbar or pagination on that table.Below the printer there print button, if click the button those all values should go to printer. function print(){ window.print(); window.opener.document.location = window.opener.document.location.href; wind...

Select the surrounding tag in jquery

I have $(this) pointing at my input box but cannot seem to reference the surrounding span to add a red border. <span id="hdr-su_name" class="eforminput"> <input type="text" size="30" id="su_name" name="su_name"> </span> I have tried this but does not work: $(this).parent().css({'border-color':'1px solid #ff0000'}); Any help mu...

Jquery Animation doesn't work in IE

Hi guys. I am trying to animate a div when the user click the button. Each button will move a div to a different amount of pixels. My code works in firefox and chrome but not IE8 (I only test it in IE8 so far). I appreciate it if someone could help me about it. my jquery $(document).ready(function(){ function breakline(position) {...

Are there any JavaScript 'packs' that can make CSS3 compatible on IE browsers?

I was wondering if there are any packages available out there to make CSS3 capabilities available to browsers that do not support it yet. The way I envision this, and I've been unable to find anything via search, is the JS would detect the browser and load its own library that essentially do the CSS3 functions using JavaScript. I kno...

jQuery quickSearch plugin to fire on click of a submit button rather than event bound on input

Hi, Am using jQuery quickSearch plugin to filter a list: http://lomalogue.com/jquery/quicksearch/ However i want to filter on click of a submit button rather than the default bindings that are supplied with the plugin itself. I have tried the following to no avail: $(function(){ var $qs = $('input#id_search').quicksearch('ta...

var replacement = $("<li>").text($(this).text()).get(0); Means?

This is a jQuery example. But i didn't get the part below: var replacement = $("<li>").text($(this).text()).get(0); The original code: var mappedItems = $("li").map(function (index) { var replacement = $("<li>").text($(this).text()).get(0); if (index == 0) { // make the first item all caps $(replacement).text($(replaceme...

Checking against any item in array being checked?

Hi, I need some help shortening this code and am just a little off. Here is original code: $("#MKDPT").change(function() { if ($("#MKDPT").is(":checked") && $("#AMX1N").is(":not(:checked)") || ("#ERXXN").is(":not(:checked)")) { alert(this.id); } }); I will be adding a lot more id's. Can I just create an array of t...

jQuery Tools: How to prevent a submit event from a form that is rendered dynamically into a page

I have an Index.aspx page with a button. If you click the button a create overlay pops up. In this overlay lies the form. So the create overlay form page and the Index.aspx are seperated. The whole form is rendered into the Index.aspx using jQuery Overlay plugin from http://flowplayer.org/tools/overlay/index.html (in $(document).ready(fu...

Format Number based on Format String in JavaScript/jQuery

Let's say I have a format string "XXX - XXX - XXXX" (to format a phone number), or any other format string in which X stands for a number I want to preserve the formatting in the format string (spacing, dashes etc.), but exchange each X for a number and drop all formatting in the source string Examples: Input: "abc+d(123)4567890",...

Problem with jQuery load() and Facebook XFBML

Hi, The situation I open a layer (jQueryUI) like this. $("#dialog").load('userinfo.html #layer').dialog('open'); userinfo.html displays the photo and the name of a facebook user. <html xmlns:fb="http://www.facebook.com/2008/fbml"&gt; <...some code...> <div id="layer"> <script type="text/javascript"> $(functi...

Animate returned elements from each() in order

I'm using this script to animate some images inside anchors: $('#locations a').each(function() { // set opacity 0 take initial position $(this).css('opacity', '0'); var left = $(this).css('left'); var top = $(this).css('top'); // reset position and animate $(this).css({'left' : '0', 'top'...

jQuery Creating a style element on fly

Hello, I'm want to create a style element after loading of page ( say about 2-3 sec after page loaded ) html <html> <body> <div id="div1" > <div id= "div2" > some text goes here </div> </div> </body> </html> javascript $(function() { var style = $('<style type="text/css" />').appendTo('head'); ...