jquery

NewtonSoft JSON, hidden field, escape chars

This is a little embarrassing question but here it goes. I have a hidden asp.net field that gets populated with a json string just before post back. I use JSON.stringify to set the value of the field like this function prepareForSave() { var commissionSplits = new Array; $("input[id$='ctlBidAgentId']").e...

How do I localize the validation messages in JQuery's Validation?

Is there a standard practice for localizing the JQuery Validation messages? I've been able to hack something together by declaring my own ClassRules and referencing them instead of the default ones. My code. <input class="localized-required" id="myTextInput" name="myTextInput" type="text" value="" /> <script language="javascript" typ...

Disable div in jquery with shadowing

I'd like to show that a div is disabled not only by disabling the form controls but also by dimming out the div itself. How can I do this? ...

.hide() is not working in Firefox but working in IE.

Hi, I want to display a layer and after clicking the close button I need to hide a layer. for this I am passing the value to the close function (user defined) in the jquery and used the below lines to close. Well it is working in IE but not working in Firefox. $('.layer_close').click(function(){ $('#TB_overlay').hide(); I tried...

Hide / Reveal available actions

I have a list: <ul class="action"> <li>Available actions</li> <li><a href="one.htm">One</a></li> <li><a href="two.htm">Two</a></li> </ul> And I would like to hide the available actions until the user hovers over them: jQuery(function($) { $('ul.action a').hide(); $('ul.action').hover(function() { $(this).filter('a').s...

zend debugger not recognize jquery post

When posting forms using jquery post, the ZendDebugger lost its track. For example, I have a file index.php wich submit button post to "formContent.php". something like: //index.php $("#formMiData").submit(function(){ $.post("formContent.php", $("#formMiData").serialize(), function(data){ $("#salidaAjax").html(da...

DOM ready callback

I ran into an interesting issue today. I have canvas elements that I am storing in a 'template'. I clone this template then append it to my document. This works fine, except that I need to draw the canvas manually after they have been appended to the DOM, if I do this in the template they are no longer cloneable and jQuery seems to lo...

jquery.browser giving false positives

I want to exclude some code from browsers earlier than ie8, but I am failing at the first hurdle. at present, my code should only detect if it is IE at all, but it doesn't $.each(jQuery.browser, function(i, val) { if (i!='msie'){ notIE = true; } }); ...

fadeOut without collapse

I have a list that I would like to fadeOut, but not have it collapse. The documentation says "Once the opacity reaches 0, the display style property is set to none". I wonder if I could fadeOut down to 1 or something. ...

Parse jQuery serialized data in C#

I have a ListBox on my page. I'm making an AJAX call to a C# function, and I need to pass the values of the selected items. Here's what I have: $('#btnSubmit').click(function() { $.ajax({ type: "POST", url: 'Default.aspx/GetSelectedValues', data: '{selectedValues: ' + $('#lbItems').serialize() + '}', ...

jQuery Explode changes fonts while exploding, how do I stop this?

Go to http://hartford.uconn.edu/scholarships/ click on any name, then click on "close" button which will show you that while "exploding" the fonts change from default "Trebuchet MS/ Trebuchet" to "Times New Roman". I have tried defining body {font-family:"Trebuchet MS", Trebuchet;} and defining other classes and change jQuery widget clas...

jScrollPane Scrollbar height relative to div

Hello, I have a resizable div which is using custom scrollbars of jScrollPane. I want to have vertical scrollbar above the resize handle, is it possible to do so? I tried changing verticalTrackHeight to be always 40 less and bar size reduces too, but when we scroll the scroller goes to the bottom. Here is my code http://www.jsfiddle....

how to show repeating divs on mouse over with jquery?

hello. for example ive got a div like: <div class="y1"> <img src="i/o.png" /> </div> and <!-- pre load --> <div class="p1" style="display:none"> <h5 class="ob">Title</h5> <img class="ob" src="i/ob.png" /> <small class="ob">Description</small> <a href="#" class="oyna">PLAY</a> </div> and this jquery <script type="text/javascript"> ...

Copy (e.g. with load or find) with jQuery an HTML Markup with included Inline Script - How to realize?

Hey Stack'er I want to crop a part of an HTML markup with Inline-JavaScript included. Example: <div id="foo"> <div id="bar"> <script> ..some function.. </script> <p>...</p> </div> </div> With the jQuery functions find() and load() you are not able to copy the whole markup WITH the JS-Snippet includet...

jQuery getScript issue in IE

We have validation rules in an external JS file that is being called via jQuery getScript: $.ajaxSetup({async:false}); $.getScript('scripts/validation/createPosting.js', function(){ checkFoapalPercentage(); }); $.ajaxSetup({async:true}); The script works fine in all other browsers (Firefox, Chrome, and Safari). Any idea why we're get...

Using element object with jQuery method?

Hi, I just started using jQuery. Now I want to use an jQuery method with an element object. var element = document.elementFromPoint(x, y); element.offset(); Of course this doesn't work because the variable element is not a jQuery selector, so the error message I get in Firebug is "element.offset is not a function". Is there any gener...

Why do I need to use .d to access data returned by jQuery AJAX?

I've put together some jQuery AJAX code using some tutorials I found on the internet. I'm new to jQuery and want to learn how to do things betters. I have a coworker who put together a beautiful web application using a lot of jQuery. The thing I'm most confused about here is: why is it necessary to use the ".d" when referring to the r...

Display modal form before user leaves page

I've used window.onbeforeunload to display a custom message when a user attempts to leave a site. Example: window.onbeforeunload = function(){ if(some_condition){ return "Are you sure you want to navigate away from this page?\nAll unsaved changes will be lost."; } }; +--------------------------------------------------------+ ...

How do I make a multiple select have an X at the end of each option to erase it?

I wanna make a select multiple list have an X to the right of each option and when I click it it should remove it from the list. I think this would be a mixture of jQuery to delete itself and CSS to add the X at the end of the option. I'm already using this javascript function: function addToList(list,firstOpt, secOpt,number){ ...

jQuery loadpage slow - animation cut

Hi, ok I try to load the .content of my site with jQuery, when I run it local, it shows smoth and nice but when I test it on a host server, the animation is too slow an cuts... and the "loading bar" doesn't show up... :S You can check it out here... here is my code and if u need something else please ask me $(document).ready(function ...