jquery

hiding and showing div using Jquery

Hi, I am using c# for programming, please see below code: <p><b> <%=ResourceFile.GetResourceString("c_FreeLiveOnlineProgramInterest")%> </b>&nbsp;<font color="red">*</font>&nbsp; <br> <asp:dropdownlist id="ddl_ProgramInterest" tabIndex="3" Runat="server"></asp:dropdownlist><br> <asp:requiredf...

Loading/Displaying large amount of data on webpage.

I have a webpage which contains a table for displaying a large amount of data (on average from 2,000 to 10,000 rows). This page takes a long time to load/render. Which is understandable. The problem is, while the page is loading the PCs memory usage skyrockets (500mb on my test system is in use by iexplorer) and the whole PC grinds to a...

jQuery insert element and overwrite

To empty a div and replace it with an image I am using: $(this).html(''); $('<img/>', { src: 'blah.gif' }).appendTo(this); Is there a better way to do this? *edit: I have to keep the $('<img/>' part in otherwise I could just do $(this).html('<img src="blah.gif">'); I know!! ...

jquery: animate $('id1').before('some html') to fadeIn and from red to transparent

I want to make something just like on this site (when you/or somebody else adds an answer) the answer appears and fades in and comes from orange to transparent, anybody knows how ? ...

Closest form append doesnt work

I am using the following code: $(".searchBtn").closest('form').submit(function () { $(this).find('.showComments tr:last').after("<tr><td>TEST</td></tr>"); }); and I have a <form> <div> <table class="showComments"><tr><td></td></tr></table> </div> <input type="submit" class="searchBtn" value="Submit"> </form> in my HTML page. Ho...

Change a regexp in application.js from rails

I wand to change the regular expression in my application.js file from within a rails controller. Is that possible? ...

jQuery UI sortable: how to emulate the 'beforeStart' event?

Hi guys, im using the jQuery UI sortable plugin for sort some tall fieldsets (~300px height). My goal is to hide the main content of that fieldset, keeping visible just the legend tag (that is actually the sortable handler)... the problem is that, as you can see in the standard events of the sortable plugin, there is the beforeStop but ...

Jquery convert string of one type to string array.....

Consider a string which is {"Table" : [{"Bird" : "Peacock"}, {"Bird" : "Crow"}]} to this ["Peacock", "Crow"] in jquery... Is this possible? EDIT: I am doing this but didnt work... $(document).ready(function() { var obj = JSON.parse('{"Table" : [{"Bird" : "Peacock"},{"Bird" : "Crow"}]}'); myarray = []...

jQuery: Quick question. How to select string variable?

Hello world, EDIT: I would like to avoid doing something like this: var str = 'Hello'; if ( str == 'Hello') { alert(str); } I would rather do: var str = 'Hello'; $(str).filter(':contains("Hello")').each(function(){ alert(this) }); I've tried a lot of things: $(str).text().method1().method2().method3(); $(str).val(...

jQuery DatePicker UI regional Default - how to set based on condition

I am aware that we can localize datepicker using $(selector).datepicker($.datepicker.regional['fr']); However can we do something like if a user passes in a value that's not supported by the datepicker regional, then automatically shift to the default language Something like: if(datepicker.regional does not support the language) ...

jquery dynatree plugin disabling child node only

Can I disable the child nodes only in jquery dyna tree. how would i do that` $(document).ready(function() { activeVisible: true, $("#tree").dynatree({ checkbox: true, persist: false, selectMode: 3, rootVisible: true, unselectable:true, onActivate: function(dtnode) { log...

Google MAP API v3: Center & Zoom on displayed markers

I use the following code to set markers on my map: var latLngs = [] $.each(locations.markers, function(i, m){ var myLatLng = new google.maps.LatLng(m.latitude, m.longitude); latLngs[i] = myLatLng var marker = new google.maps.Marker({ position: myLatLng, map: map, shadow:...

Why does jquery button take a second to refresh after updating a page using ajax

when i refresh a part of a webpage that has a jquery ui button, it seems like I have to call: $(":button").button(); again or it shows up as a regular button. Thats fine but when i do this, it still shows up as a regular button for a split second before converting to the styling of the jquery theme. is there anyway to avoid this as i...

jQuery .click() not binding properly

I want to perform some action when a link is clicked, I am using the following code to achieve this however it rarely works. If I click the link it usually refreshes the page, and 1/10 times it'll actually pop up "Hi". What is wrong? $(document).ready(function() { $('#slconfiglink').click(function() { alert("hi"); ...

Setting a session using jquery without page reload

I have a problem, how can I set a session using jquery(AJAX) without page refresh.My problem is the session is not set unless I press on the refresh button so as to set the session.My php page is separate from my jquery code. This is a login function am trying to implement Any help will be greatly appreciated. ...

jquery returning null - why?

I am using jquery ajax $.get which calls a php script on my server and retrieves content from another site (domain). It return's the full web page ok. I then want to extract html data from the 'center' tag using the .find() method, but I am having some issues. $("#btnGetData").click(function(){ $.get("pgiproxy.php",{ data: $("#formdat...

Jquery Modal Dialog disables form elements

Hi, When I set my jQuery dialog to model=true, it disables my form elements inside the dialog and I cannot use them, only the buttons. I have seen examples where the contents of the dialog is declared in the dialog initiation script and then injected. but that is just to bulky for me, I want to be able to create my markup inside the DIV ...

get the src from img tag

I am using ajax to grab a page. withing a table lies an imagesrc i want to grab.. It is wrapped around an A tag with a class name i use the following $response.find(".infobox tr").each(function(){ $a=$(this).find(".image").html(); } but it returns the image tag <img src="http://uwww.domain.com.au/image.jpg" height="333" width="256"...

Javascript - .toJSON

Hi folks, i am newbie to JSON & hence i am not sure what $.toJSON(params) means? Please explain what this does? TIA ...

How to make JCarousel Vertical Scroller reverse scroll?

I was able to instantiate a working scroller using jQuery Jcarousel however I need it to reverse scroll. For example right now I have: jQuery(document).ready(function() { jQuery('#mycarousel').jcarousel({ auto: 1, vertical: true, scroll: 1, animation: "slow", wrap...