jquery

Using JQGrid in conjunction with WCF Web Services

I am trying to obtain the data for JQGrid from a WCF Web service that is running from within my ASP.NET 2.0 WebForms application. The problem is that the WCF Web service expects the data to be formatted as a JSON string, and JQGrid is performing an HTTP Post and passing it as Content-Type: application/x-www-form-urlencoded. Although ...

How can I update a ASP.NET MVC ViewData via jQuery ajax?

Hi!! I have a page that highly depends on a IList (in ActionResult "MyEvents") that I pass in ViewData. Something like that: ViewData["events"] = listOfEvents; and in the end, I just return View(); And in my View, I take this ViewData["events"] and do a foreach in it so I can iterate through its contents. But, this ViewData must be dy...

jQuery change property on load

Hi, I have this HTML <div id="navContainer"> <ul> <li class="selected"><a href="#">Home</a></li> <li><a href="#">Services</a></li> </ul> </div> And I want to change the top border of the li next to the selected one (in this case 'Services'). I have this jQuery but it does not work. $(document).ready(function(...

Run JQuery in the context of another frame

Hi, The client I am working with has a frameset like so... <frameset rows="100,*, 0"> <frame name="theFrame" id="theFrame" src="blah.html" > <frame name="theSecondFrame" id="theSecondFrame" src="foo.html" > <frame name="importantFrame" id="importantFrame" src="myFrame.html" > </frameset> When a certain action takes place I need...

Using jQuery to find the number of TR elements in a given table

I have seen several examples on how to find children, etc but for some reason I can't get this one right ... any help from the SO community? The below is my current "attempt" in code -- var trCount = $("#table > tr").size(); ...

jquery form plugin & programmatic submit

There are similar questions at SO, but none that seem to address this. Below is a very simplified variant of my situation. Drupal/PHP site -- I have a form w/ submit button that I am using jquery.form plugin to ajax-ly submit. It works fine if I use the submit (#submit) button. Now, I want to programmatically fire that button using an...

Change Image Source using jQuery

I have a few images and their rollover images. Using jQuery, I want to show/hide the rollover image when the onmousemove/onmouseout event happen. All my images name follow the same pattern, like this: Original Image: Image.gif Rollover Image: Imageover.gif I want to insert and remove the "over" portion of image source in the...

Verifying RECAPTCHA with jQuery

Hi. I'm trying to verify a Recaptcha using jQuery, but I keep getting an error telling me: Access to restricted URI denied" code: "1012 This is what I've tried so far: var challengeVal = $("#recaptcha_challenge_field").attr("value"); var reponseVal = $("#recaptcha_response_field").attr("value"); var remoteIp = <%= "'" + Request.Ser...

MonoRail redirect to # anchor

I'm using Castle Monorail with jQuery tabbed navigation. When handling a controller action, I would like to redirect to a view, and control which tab is visible. Therefore, I'd like to have my controller redirecting to a specific anchor in a view, something along the lines of: RedirectToAction("Edit", "id=1", "#roles")); Resulting in...

jquery change element type from hidden to input

I've got an input which it's type is set to hidden, I need to change it's type to text. Can't seem to figure this out or if it's possible with jQuery ...

jQuery - suggestions for a "nextWhile" traversion?

jQuery currently has .next(filter) and .nextAll(filter) but I need something that fits in the middle of these - effectively, a .nextWhile(filter) that repeatedly does next until the filter is no longer true, then stops (rather than continuing to the end). To demonstrate this, the following is some simplified HTML - (in reality, it is dy...

How can I speed up jquery :selected selector?

I have a dropdown in a web page with 3830 elements in it. I know, excessive but whatever. In jquery I get the selected option value using the statement: $( "#institutionCombo :selected" ).val(); There is a noticeable pause before the selection is found. Once I get that value I insert it into a textbox on the page, so I know how fast. ...

Passing jquery selector to sub-function within a plugin

Hi There I'm trying to make a quick jquery plugin (as a learning exercise) for making a simple pager from a list of items (LIs in this case) and have run into a problem when passing the current selector (this) to a sub-function. The code is below. The problem is when creating the dynamic nav (the plugin requires jquery 1.3) and I need...

How can I create a draggable table in jquery?

Hi, I have a table whose columns indicate a property of data items. Each item is then placed into its appropriate column, meaning some columns might be empty, and certainly the columns do not all contain the same number of elements (or rather, the last n elements in each column are empty, apart from the column that has the most elements...

Getting intellisense to work for JQuery and javascript in .js files using Visual Studio 2008

I followed ScottGu's advice on enabling javascript intellisense using a -vsdoc.js file. http://weblogs.asp.net/scottgu/archive/2008/11/21/jquery-intellisense-in-vs-2008.aspx I now get intellisense when I write javascript inside my HTML/ASPX files. I write most of my javascript in separate javascript files that I attach to my code with...

moving more web presentation logic to javascript via jQuery

I am building a new web based application in asp.net. Our backend has existing WCF/REST services that are returning JSON. I also have a JavaScript library that wraps up calling/consuming these JSON services for me client-side. This enables the app to make client-side AJAX calls and do things like a client-side repeater (Rick Strahl ha...

How do I get the number of days between two dates in jQuery?

How do I get the number of days between two dates in jQuery? For example, given two dates in input boxes: <input id="first" value="1/1/2000"/> <input id="second" value="1/1/2001"/> <script> alert(datediff("day", first, second)); // what goes here? </script> ...

Recommendations for jQuery tooltips

I am looking for tooltip plugins for jQuery that would allow for the following type of behavior. <a href="somewhere.html"> <span> <img src="someimage.jpg" style="display: none;" /> Here is the tooltip content. </span> Here is the link to somewhere. </a> The behavior that I am hoping for is to hover over "Here is the link to som...

how to fix shifting after animation in IE

Hi, I just made a text animation (fade in; animate(top, opacity)) and at the end, the text went about 5px left then returned to its original position, quite quickly. This happened in IE only; all other major browsers behaved normally. Any idea about why it happens, and how to fix it? I am interested in fixing IE7 in particular. Thank...

Can't Submit Form With Simple Validation with the JQuery Form Plugin

I am using the jQuery Form plugin to submit AJAX requests. I am trying to do some simple validation (make sure fields are filled out) before submitting. I am not trying to run any AJAX validation prior to submission. Before I added beforeSubmit to the options of the ajaxform() method, the form would submit and my controller code would ru...