jquery

Preview button action captured by popup blocker

I want one of the page adding editors on site to have a preview buttons associated with it. When user clicks preview the content gets saved and if the save is successful a page preview window is launched. The problem here is that the preview windows is blocked by browser's pop-up blocker. What can I make to "fool" the browser ? I was t...

Setting the value of a textarea in jQuery

I am trying to set the default value for a form field in SharePoint and am having a bit of trouble getting the code to work in IE. I have tested Firefox and Chrome successfully. Any ideas why IE would not be setting the value? <script type="text/javascript" src="http://www.qg.com/shared/cache/jquery/142/jquery-1.4.2.min.js"&gt;&lt;/sc...

JQuery / ASP.NET newbie questions about <asp:Button>

Hey all, having an issue getting asp buttons to interact with JQuery. I'm basically trying to hide a div that contains a form and replace it with an processing image. It works fine for me when I use an HTML input button as the trigger but when I use an aspButton nothing happens. This works (the id of the HTML button is 'btnSubmit'): <s...

What does this mean ? >> ActionController::InvalidAuthenticityToken

I was curious what that meant in general. But here is the specifics.. I'm doing a sortable jquery project, that touches this rails action : def update_order params[:media].each_with_index do |id, index| media = @organization.media.find(id) media.do_not_touch = true media.update_attribute('position', index+1) end if par...

Can I DRY up these jQuery calls?

Is there a way to DRY this jQuery up? <script type="text/javascript"> $('form input#search').watermark('search...'); </script> <script type="text/javascript"> $('form input#post_title').watermark('title'); </script> <script type="text/javascript"> $('form input#post_tag_list').watermark('tag (separate tags with a comma)'); </scrip...

Can't make jquery validation with ajax.beginForm in PartialView work

I'm loading partial views which are ajax Forms. They look like this <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<WebGRC.Web.Controllers.Models.Administration.UserAdminModel>" %> <%@ Import Namespace="WebGRC.Web.Controllers.Models.User" %> <h2><%=Html.Encode(ViewData["HeaderText"])%></h2> <% Html.EnableClientValid...

How to set sort rules on jqgrid?

I am using jqGrid. One of the columns has the possible values: Poor, Fair, Good, Very Good, Excellent, Ideal But when you sort by this column they are ordered alphabetically like: Excellent, Fair, Good, Ideal, Poor, Very Good Instead of the intuitive order you would expect. Is there a way to correct this? update Here is a snippe...

JQuery: Asynchronously loading DIV tag(only) with latest feed using Google-Ajax-Feed-API

Hi Everyone I am writing a code using Google-Ajax-Feed-API to get latest feeds from some site. I want the feeds to be checked for update every(say 1 secs?). I am able to retrieve the blogs but not able to refresh the DIV tags. Any help will be useful. <script type="text/javascript"> google.load("feeds", "1"); $(documen...

Ajax calls in JQuery always return successfully but 'data' parameter is an empty string

I am just trying to test a simple ajax call on my server using jquery I have a HTML file like this <!doctype html> <html> <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(function(){ $("#connect_button").click(function(event){ $("#placeholder...

Jquery: function running before fadeOut Complete

I'm having an issue with my jquery script... should an easy task, but having some strange behaviours that I can't figure out. When I click on a link, I want my content to disappear, then the new content to reappear. All content is stored in tags. Here's what I'm using: $("#events_link").click(function() { $("#content").children("....

jquery tab communication

How to create tabs corresponding to the main vertical menu.... Say I have a vertical menu submenu 1 submenu2 submenu3 Menu 1 Menu 2 Menu 3 ect . Now on clicking i need to show the submenu in tabs as above ...and each time I click previous submenu will disappear and new will appear in the same place ...

Trying to check if a checkbox is checked, please, what am i doing wrong?

$(document).ready( function() { $('input[id^="btnRemoveCategory"]').bind( 'click', function(){ if($('input[id^="chkIsBottom_":checked]')) alert('YES YES YES!!!!'); else alert('No NO no!!!!!'); I've tried with the: if($('input[id^="chkIsBottom_"]').attr(chec...

jQuery select box populate issue with IE

I am new to jQuery and i came across a select box population code which work perfectly in Firefox,chrome, opera but not in IE. In this code the first select will be populate the directory structure and as user select the select box the second select box should be populated according to users choice. But in IE the second select box is not...

jQuery Offset and Page Scroll for Drop Down Menu

I've got a small issue with the .offset().top value in jQuery. I'm making a drop down menu function that binds to my selector as follows: $('.navButton').mouseenter( function(){ var x = $(this).offset().left; var y = $(this).offset().top; var height = $(this).height(); var dList = $(this).find('.d...

Custom jQuery validation plugin

My boss asked me to program a custom jQuery validation plugin. If <input /> tag has special attribute [needcheck], my plugin must determine the type of [needcheck] and check input data before submit. For example: <input name="email" type="text" needchek=”Email”/> If value of <input /> tag has errors, plugin must show a promting ...

jQuery - How to slide the bottom part up after the top part is fadeout?

Hello all, I have a page as follows: <div id="warning_msg"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam, justo. <span id="closeerrordiv" class="notify-close">×</span> </div> <div id="bigForm2"> Lots of content here </div> <div id="bigForm..."> </div> <div id="footer"> </div> <script type="text/ja...

Canvas and jQuery?

Is it possible to use the JavaScript jQuery framework with the HTML5 <canvas> element? Or do I have to do it with plain JavaScript. I'm just wondering, because I think I could save a lot of time with using jQuery, but I have no clue about the <canvas> element's uses yet, so it may be completely impossible! Anyone know if I can use jQu...

JQuery WCF .net 4 Rest 405 Method Not Allowed Trivial

I keep getting a 405 Method not allowed. The script is hosted on same port as server, using IIS. <script> function auth() { var str= '{"Password":"Password","Username":"Username"}'; $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "http://127.0.0.1:8080/auth/authenticate", data: s...

jquery loadBefore or loadAfter

I was wondering if anyone knows of an efficient pattern for dynamically loading html. jQuery's load method allows a developer to load html into a specified element. I would like to insert the html before a certain element. For example html <div> <div class ="child"> </div> </div> jQuery jQuery('div.child').load('ex.html'); ...

When creating new element in jQuery, is there a method that is faster?

Is there a way that has better performance than the other when appending a new element to the dom with jQuery? This is the way I usually do it: $('<div class="foo">Hello World!</div>').appendTo($("#bar")); But I've seen this quite a few times around : $('<div/>').attr("class", "foo").text("Hello World!").appendTo($("#bar")); I thi...