jquery

Posting cross-domain JSON to ASP.NET with jQuery

Got kind of a tricky problem. I'm working on a project where we need to allow receipt printouts when users check out on our site at a kiosk. For reasons relating to drivers and formatting, I am using COM automation with Word to handle printing out the receipts. I've wrapped this code up in a web service that runs on a local machine. Th...

jQuery event help - I have a Select list with OptGroups, I want to call function only if option belongs to a certain optgroup

Hi All, I have a select list with optgroups. I want to add a handler for the drop down selected index change, how do I tell which optgroup the selected item belongs to? This determines further execution path. I understand how to add the function, the function contents are more the issue. $ddl.bind("change", function(){ //how do I find...

jQuery cluetip: Manipulate content after rendering

Hi, I may be stating this incorrectly, but is there any way to manipulate (using JavaScript) the content in an cluetip once the content has been (dynamically) loaded to the external .jsp? I have a list of items being displayed, and I want to bold some of them. I cannot add ID's or classes individually to any of these items in the list, ...

Using Jquery $.get within document ready

Could someone explain why the alert statement would return nothing when used in this context: $(document).ready(function(){ $.get("/getsomedata.php", function(data){ $("#mydiv").append(data) }); alert($("#mydiv").html()); //outputs nothing }); When this statement returns what you would expect: $(documen...

Nested element won't remove parent class

The class is set on an <li> by it being clicked. Now a nested element (<button>) will not remove the class from it's parent. Thanks in advance. $(document).ready(function() { $('.pickOne li').click(function() { $(this).addClass('active'); }); $('.settingsCancelBtn').click(function() { $(this).parent()...

Will I be able to read this through Ajax (jquery)?

I need to call the server AJAX-way, just to get 1 parameter: Must I do this through JSON? Or, can I just shoot this through like a regular HTML page, like this: 4 or 6 Then, will JavaScript be able to read that line? If so, how can I do this using jQuery? ...

Simulate a focus() and blur() but actually using a val() in jQuery

Hi there, I'm trying to pass a value to an input box via json. I've been using: $.getJSON(('somedata.json', function(json){ $('#myinput').val(json.values); }); Works fine. But I needed it to look as if someone focused the input box, typed the json.values inside and then blurred it, because my input box does all sorts of stuff ...

jquery img select

Hi, I have a h4 with an img in it like this. I bind a click function to the h4. This works well. But I'm not able to select the img in it. I want to select the img in order to replage the src attr with .attr("src").replace("up", "down"); . <h4 class="collapsable_head"> <img id="up_down" class="icon" src="/crm/img/modifier_down.gif" alt...

How to use JQuery ajaxForm with nicEdit?

I am using ajaxForm function to submit my form that has nicEdit html editor as well but when I tried to submit the form for the first time the content of the nicEdit is not included... Is there a way that I can intercept the data submitted so I can edit the form data? or maybe add values to the form-data before it actually gets submitted...

What does /.*=/,'' mean in var id=this.href.replace(/.*=/,'');?

What does /.*=/,'' mean in var id=this.href.replace(/.*=/,''); ? Full code function delete_subscriber(){ var id=this.href.replace(/.*=/,''); this.id='delete_link_'+id; if(confirm('Are you sure you want to delete this subscriber?')) $.getJSON('delete.php?ajax=true&id='+id, remove_row); return false; } I assume it is regex, bu...

How can I make a DIV take up the rest of the height of a container div?

Hi All, I have a div with two nested divs. The first child has varying height depending on its content, I want the the 2nd divs height to be whatever is left over from the parent. <div style="height:500px;"> <div>Some Content Here</div> <div>This div needs to take up the rest of the space of its parent</div> </div> How can I do...

Write own JQUERY Plugin for multiple instances

Hi there, I'm a newbie when it comes to writing plugins, but I like to learn ;). I got the following wish. I want to write a plugin that turns a "div" with an id to a uploadform for an image file. By setting options I want to pass values for height/size/extension etc. I want to be able to use the plugin more then once on a page. for ...

Assign variable to manipulated data from jQuery getJSON results

How to assign a variable to returned JSON data that has been manipulated with .replace() as shown below. Purpose: build the URL for the video thumbnail image from video ID returned by JSON. Question: How to assign a video ID (ex. mVWhWsgHzKM) to a variable so thumbnail URL can be constructed. $.getJSON( 'http://gdata.youtube.com/fe...

clicking on a div's scroll bar fires the blur event in I.E.

Hi, I have a div that acts like a drop-down. so it pops-up when you click a button and it allows you to scroll through this big list. So the div has a vertical scroll bar. The div is supposed to disappear if you click outside of the div, i.e. on blur. the problem is that when the user clicks on the div's scrollbar, IE wrongly fires ...

Creating the Cover Flow effect like Apple with jQuery

Hi there, I'm looking to recreate apple's cover flow effect using jQuery. I've looked at some various options and came across: ImageFlow -> http://imageflow.finnrudolph.de/ (just javascript, not jQuery) cFlow -> http://blarnee.com/wp/cflow-coverflow-for-jquery-experimental-release/ xFlow! -> http://www.pwhitrow.com/blog/entries/2009/...

a element in nested divs, jquery events not working.

i want to use an event of an anchor element in some nested div's but something is not working in my code. i tried hundreds of variations on that selector but it still does not work. html code: <div class="tabContents"> <div class="thumbArea"> <a href="#"> <img src="foo" alt="baba"/> </a> </div> <div class="imageArea"> ...

jQuery Tablesorter - sorting by clicking a link

Hello, I'm using jQuery Tablesorter to sort a table and everything works as expected. What I'd like to do is add a link above my table that says something along the lines of "Sort by Price" and when the user clicks the link I want the "Price" column to sort. Additionally, if they click it again, it would sort the price the other way. Is ...

How to upload a file through jquery?

Hi I am wondering how would I do this with like jquery ajax. Right now I have a jquery ui dialog box popup and it has an html input file on it. Now when the user clicks import I want to do an ajax post to the server with jquery. I am not sure how to pass the file in though to my action view. Right now I have it doing a full post bac...

Access hiddenfield using Jquery

Hi, I have a page that's derived from a master page. On this page, I have a hiddenfield ("hfUser"). How can I access this "hfUser" control and get/set its value using JQuery? I've tried variants of this: $(document).ready(function() { var test = $("#hfUser").val(); alert(test); }); but test = undefined. I'm guessing I've g...

Disable a function

I have a tooltip that I want to disable. It is from this site and is basically set and called as follows: this.tooltip = function(){....} $(document).ready(function(){ tooltip(); }); I don't want to unbind the hover or mouseover events since they are also tied to other effects. I have tried to disable without success as follows (at t...