jquery

Are there any jQuery tutorials that demonstrate authoring plugins to accept selector syntax?

I'm attempting to write my first jQuery plugin to query multi-dimensional arrays of complex objects. It kind of functions how I want it, but right now it receives a property name and value as input for comparison of the items. I want to modify it so that it can receive jQuery's selector syntax as input in order to filter my objects in ...

Javascript/jQuery move to next field on keypress

When a user presses the down arrow key in a textarea, and it's the bottom of the textarea (i.e. the keyup has no effect), I'd like to an event handler to capture this. $("<textarea />").keyup(function (e) { switch (e.keyCode) { case 40: // down // if last line or alternatively // if keypress does not chan...

Update dropdown values

In the ViewModel: SelectSafetyContacts = new SelectList(subcontractRepository.GetContacts(Subcontract.company_id), "contact_id", "contact_name", Subcontract.safety_contact); In the Repository: public IQueryable<contact> GetContacts(Guid id) { return db.companies .Where(c => c.active_status == true) ...

Good/Simple shopping cart example using asp.net mvc and jquery

Is there a Good/Simple shopping cart example using asp.net mvc and jquery? Any suggestion... ...

How to grab textarea value, and maintain the HTML Styling

Hello, I'm building a comment module for my web application. In the application I need commenting. When a user posts a comment, I would like jQuery to grab the TextArea's value and then insert it into the page <p>. Problem is that when it inserts the contents it loses the HTML formatting, mainly page breaks/returns which confuses users....

Does datatable work with Ubuntu?

I've been trying to make a datatable..but the data still does not show although the datatable's head and icons all show. I tried to get rid of the scripts, one by one, to search for the problem. I've copied all script at datatable.net (with copy-and-paste) but the data still does not show. Is this script not compatible with Linux Ubun...

Conditionally skip form fields from submission, Reduce URL clutter

I have multiple hidden form fields which store values about the the current view (e.g. if certain, normally hidden div's are visible etc.) to restore the layout when the form posts back. The problem is that I'm always submitting all these hidden fields, even if they are in default, generating lots of unnecessary URL clutter in the proce...

One Input - two styles? Left side cursor:text, right side cursor:pointer ?

Hello! Is there a way (using javascript/jQuery) to do following: On my page, I have one input type=text. This input has a background-image on its right side. <input id="my-input" type="text" value="foobar" style="background-image:url(path/to/my/image.gif); background-position:right center; background-repeat:no-repeat; height:17px; widt...

Child node shows twice while Drag

In ASP.net TreeView control, I had used jquery for dragging a node and display dragged node text when dropped. I wanted to drag the node, while that node should not be moved from TreeView. So I had passed "helper:'clone'" as argument through "draggable()". I got the result by not moving the node. But while dragging, the node text is bein...

How can i call [WebMethod] which is defined in user control ?

I am working in asp.net using C# and I have a [WebMethod] defined in User Control. I dont want to use web service. My Question is : How can i call this any method which has [WebMethod] attribute? I want to call it from jQuery (Ajax) request. Please help me ...

JQuery - how do I exit user defined function?

I have a function that runs on document load: function animateText() { $('.block') .css("background-image", "url(images/text-4-line-1.png)") .animate({left: "526"}, 1, "linear" ) .delay(2200).fadeIn(1000) .delay( 3000) .fadeOut(1000) $('.block2') .css("background-image", "url(i...

jQuery - sharing vars between functions

This should be fairly simple; i'm pretty sure I've just not understood it. FYI, the website is using jQuery to run ajax .load() on content. On my main parent page, in the header I have my nav .load() jQuery code:- <script type="text/javascript" charset="utf-8"> $(document).ready(function(){ $('a.nav').click(function() { ...

after toggle tinymce editor, it does not send the comeplete string

Hello All, i m using tinymce editor on joomla component that behave strangly tinymce is already present (automaticaaly) on page load ..now if i write something on tiny mce editor( eg: 'with tinymce') & then click on toggle editor button ( now simple text area appears) and i see <p>with tinymce</p>, now if i append some text...

How do i convert a json object to a string?

How do i convert a json object to a json string? var o = { name: "a", id:5}; var sz = //??? alert('The json will look like ' + sz); -edit- i forgot i would like to do it in jQuery or naively if possible ...

JavaScript: How to efficiently replace all values of an object without replacing the object

I have a number of objects collected in an array. The same objects are also attached to certain DOM elements for various reasons. From time to time I need to update one of these objects. The easiest way to do this is to find the object in the array with the same id property as the one I got new values for through AJAX and then replace it...

Forced selection in hidden / Backend using Javascript OR JQuery

Hello, I have regular form like this. <form action="/domainchecker.php" method="post"> <input type="text" name="domain" size="20"> <fieldset> <select name="ext"> <option>.com</option> <option>.net</option> <option>.org</option> <option>.us</option> <option>.info</option> <option>.biz</option...

How to make client side validation when loading Partial View in my page using jquery in Mvc2

I am returning partial view public virtual PartialViewResult Create() { return PartialView("Create"); } and loading the view in my page when clicking create button with jquery function createVendor() { jQuery.ajax({ type: 'GET', url: 'Vendor/create', success: function (result) { $("#popup"...

jQuery.Cycle - use two different effects on same container

Hi there I'm currently using jQuery.Cycle to cycle through a few child <div> tags. However, I want the default cycle fx to be fade, and when I click on the next or prev selectors, I want the cycle fx to temporarily change to scrollRight or scrollLeft depending on the selector clicked. Is this possible? jQuery code, if necessary: $('#...

flowchart and javascript

hello I am looking for a javascript library for drawing flowchart and Organization Charts in my Web project, someone know a good a library? thanks ...

jQuery: Difference between position() and offset()

What is the difference between position() and offset()? I tried to do the following in a click event: console.info($(this).position(), $(this).offset()); And they seem to return exactly the same... (The clicked element is within a table cell in a table) ...