jquery

jqGrid sort icon displayed when no sorting performed

In our grid we do not have sortName or sortOrder defined but the first column has the sort icon displayed (in ASC order). How can you prevent the sort icon from appearing? Update: Code below $("#list").jqGrid({ url:'NoData.json', datatype: 'json', mtype: 'GET', colNames:['Product', 'Type','Expiry', 'Put Call', 'Str...

Any way to toggle between two strings using one piece of JavaScript?

HI all I want to do something like if(something.val() == 'string1') { something.val('string2'); } else if(something.val() == 'string2') { something.val('string1') } But in one line of code. I can't quite remember how it's done, but it involves question marks and colons lol Sorry to be vague James ...

jQuery: How to queue a function to complete after an array of animations?

I am trying to animate a table row sliding up, then adding a new table row, and animate the new table row sliding down. I have read up on how to animate a table row, now I am trying to queue up these animations. <table> <tr> <td><div><a class="trigger" "href="#">Hide this row and add a row after this one</a></div></td> ...

[Javascript] Getting the URI used to load a div on a page?

I have a div on a PHP-generated page loaded through jQuery's .load() function. This div contains a long list which has been paginated (links for page 1, 2, 3... 25, etc.). I'd like to write a function which will preserve the variables in 'search' portion of the URI (which is to say at the end of the URI: ?foo=1&bar=pancakes) and stick ...

Need jquery selector

I have the following snippet of code on a page that I need to specifically target the number inside the b tag and put that number in a variable. I do not have direct access to this code or I would put and ID there. There are more than one td and b tags on the page but only one font size"3". What would be the correct selector to target th...

Javascript this in jQuery

Hello, I saw some old code that had: <input type="submit" name="submit" onsubmit="somefunction(this)" /> I was jQuery'ing the script, how do I get the pure javascript (this) object in jQuery? $("input[name=submit]").click(function() { somefunction(// ?? is it $(this) ); }); Thanks! ...

Force .change() function to run - jQuery

I have a .change() function set for a dropdown menu with an ID of #country. When the page loads, I'm trying to set the dropdown menu to "United States" and run the .change() function: $('#country').change(function () { resetDisclosure(); var countryCode = $(this).val(); var countryName = $('#country option:selected').text()...

move jquery slider with text links

i have to modify this page https://www.bcidaho.com/healthcare-reform/timeline.asp to use text links to move the slider to the relevant content. the text links will be the months/years at the bottom of the slider. right now i just uses the default handle on the slider. just looking for insight on where to begin my quest for a solution....

Keeping Pop-ups in viewport

Hello, I am using a Superfish plugin to display menu pop-ups but the problem is when a menu item is big it gets overflow from viewport. How can I adjust the position of pop-up menu to always keep it in the viewport. ...

jQuery: How to move all CSS styles from one element and apply them to a different element?

I have an external stylesheet that is applying styles to my TD elements. I would like to move those styles to the DIV tags (content wrappers) that are within the TD tags. The CSS: td { padding: 5px } div { } The HTML: <td> <div> Apply the TD styles to this DIV (instead of the TD). </div> </td> The JavaScript: $(do...

jquery-ui dialog: how to add tabs to content area ?

How can you add tabbing to the jquery-ui dialog content area ? ...

Difference between JQuery plugin and a function

When I look at the JQuery plugin code, it almost seems to me that we are creating a function (although we use the JQuery.fn syntax) Functionally, what's a difference between a function and a plugin? ...

Where to place my JS code and where/how to load multiple jQuery plugins?

I have a couple of questions that are somewhat related so I'm posting them all on a single question on SO... Question 1: I'm currently doing this Facebook application where I'm using jQuery UI Tabs, there's only 4 where 2 of them are loaded through Ajax. The main page is index.html, this is where the tabs code is placed and for the 2 t...

jquery datepicker- ie only lets me have 5 where firefox doesnt care how many

Hi guys. I am developing a web system that has 12 text boxes. When you click on this textbox, a jquery datepicker pops up. Before I post code up, just wandering if there is a simple answer. Basically, IE will not let me have more than 5 instances of a datepicker. E.g. I have 12 text boxes and when you click them, the date picker comes...

JQuery: .getScript() is not working when loaded from a .load()

You can see the way its suppose to work by visiting: link text That is loading everything using standard loading. You can attempt to get it to load dynamically here: link text and then simple just click the "Parts" link... As you can see no alert every comes to me. I have a feeling it has to do with the ability of detecting when to fi...

Why is it acceptable to expect that Flash will be available/enabled, but not JavaScript?

It doesn't take long when surfing the web to observe the general consensus that Flash is an expected standard, that it's okay to say "If you don't have Flash, my website won't work." Yet in the same regard, JavaScript is expected to degrade peacefully if the user does not have it enabled. I personally favor the "HTML5" approach, in oppo...

Serializing a javascript array with Jquery

I have the following code: <script type="text/javascript"> var checksSinceLastPostBack = new Array(); function clientSelectedIndexChanged(sender, eventArgs) { var ajaxManager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>"); var serializedCheckData = checksSinceLastPostBack.serializeArray(); if (ajaxManager != nu...

weird jQuery JSON function... whats going on here?

Im browsing the flot examples here http://people.iola.dk/olau/flot/examples/turning-series.html (view source once there) I came across this : <script id="source" language="javascript" type="text/javascript"> $(function () { var datasets = { "usa": {... The $(function() part. I get that its an anonymous function, I dont g...

Getting JSON from a .NET web service with JQuery

I am working with the FullCalendar module (great, btw) and I'm having trouble populating events from the database. I am receiving a JSON string created by a C# web service. However, when I try to parse it and print out test alerts, I get nothing but "undefined". My response string looks like this in Firebug: {d="[{"ScheduleRecId":9,"Em...

fx.slide on load?

Im a little stuck with fx.slide, im trying to run it on page load event. Is there a way to do that? click event is this var myHorizontalSlide = new Fx.Slide('wrapper', {mode: 'horizontal'}); $('.href').addEvent('click', function(e){ e.stop(); myHorizontalSlide.slideOut(); }); ...