How to redirect to root page in Rails in jQuery?
I'm now redirecting to main page in my Rails application using redirect_to root_path I want to do the same in jQuery. i.e. window.location.replace("???"); How to do that? ...
I'm now redirecting to main page in my Rails application using redirect_to root_path I want to do the same in jQuery. i.e. window.location.replace("???"); How to do that? ...
I have a problem with getting jquery to retrieve results from a WCF service. I am hosting the WCF service within IIS and when I attach the debugger to this process I can see that the code is processed successfully. However, when it hits the callback within jquery there is no data?? I have set up a trace on the wcf service and there are ...
Assuming i have: <li id="1">Mary</li> <li id="2">John, Mary, Dave</li> <li id="3">John, Dave, Mary</li> <li id="4">John</li> If i need to find all <li> Elements which contain "John" and "Mary", how would i construct the jQuery? A search for a single string seems easy: $('li:contains("John")').text() I am looking for something like...
Hi, I was trying to iterate through a collection of objects and was trying to set an attribute for each of the object. Here is the code: $(document).ready(function() { $('#clickButton').click(function() { var hiddenVal = $('#hdnVal').val(); $('*').find('*[tabindex]').each(function(index) { ...
Hi, Basically, I do not want the user to enter '0' (zero) as the first character in a textbox which represents data with type of integer? I would like to bind an event handler to handle this with jQuery. Any experience? Thanks, ...
Why this two functions have the strange behaviour of when I click on thead, the tbody expands and then collapse. On the second function could do some testing adding alerts to the if, else statement but it only gets into the if statement so it would only slideUP. Another thing I notice is that when there is only one row in tbody it work...
Hello, I have a container div where several spans are draggable. I want to build an UNDO function for them. I am thinking at: when span attributes are changed (position, css) the script detects a DOM change the DOM change is stored via HTML5 localStorage When the UNDO function is called the last version of the DOM replace the current. ...
I'm populating select box options via jquery and json but I'm not sure how to address multiple instances of the same chained select boxes within my form. Because the select boxes are only rendered when needed some records will have ten sets of chained select boxes and others will only need one. How does one generate unique selects to s...
Hi, I made a jQuery loader for my content div. However it doesn't display my div class="typeface" anymore. This means I can't use different fonts. The rest of the content div works properly. Can anyone help me? Javascript code: (for elements) $(document).ready(function() { // Check for hash value in URL var hash = window.l...
Hi, We all know that you use this structure to make an accordion <div id="accordion"> <h3><a href="#">First header</a></h3> <div>First content</div> <h3><a href="#">Second header</a></h3> <div>Second content</div> </div> But what if you want to create an accordion, using the code already in place, set by a terrible CM...
I am working on a php that application that uses ajax. On all the links where i want to get the link hijacked by jQuery I add the class ajaxlink directly into the link <a class="someclass ajaxlink" href="somelocation1">goto1</a> <a class="someclass ajaxlink" href="somelocation2">goto2</a> <a class="someclass ajaxlink" href="somelocation...
I have an order form with about 30 text fields that contain numerical values. I'd like to calculate the sum of all those values on blur. I know how to select all text fields but not how to loop through them and add up all their values? $(document).ready(function(){ $(".price").blur(function() { //loop and add up every value from...
I'm using 3 views in my calendar: month, agendaWeek, and agendaDay. After I add an event, I call refetchEvents to display the new event. If I add an event from agendaWeek or agendaDay, the refetch will of course grab the events for the week or day. If I then switch to the month view, I only have the events for the week or the day. I've ...
I have ran into an interesting issue while trying to create a more usable datepicker-like interface. I am using a slider to change the month of a listed calendar (Mar 2010, Apr 2010, May 2010, etc.) A very simple mock-up here: http://dev.primestudiosllc.com/riverbank/ I will need to first get the current month and set that as the begin...
Alright folks: I've got my own custom JQuery validation being called through $('#aspnetForm').submit() Unfortunately, this means the validation gets called no matter what validation group the control being validated belongs to. Can anyone think of a good way to bypass this problem? I can access the Validation Group (in theory) via the...
<div id='one'>one</div> <div id='two'>two</div> function Red(e) { $(e.target).css('color','red'); } // if i bind an event click to div='one' with fn "Red", function "Red" will receive e="div one", now i want to bind some event on div=two so that it send div=one to function Red. remember: i don't want to bind any event to div=one...
I have some javascript which catches changes to a form then calls the form's regular submit function. The form is a GET form (for a search) and i have lots of empty attributes come through in the params. What i'd like to do is to delete any empty attributes before submitting, to get a cleaner url: for example, if someone changes the '...
I need to raise a couple of events with parameters within a jquery plugin, looked at similar questions, but cant seem to see what I am looking for? ANy basic examples out there? ...
Is there a difference in performance (I am not asking about readability) if I condense my code into one line versus two? For example: var slide = 'images/' + n + '.png'; $('img').attr('src',slide); versus $('img').attr('src','images/' + n + '.png'); Personally, I like fewer lines of code. Often, I am the only one reading my co...
Hello, I'm having trouble getting JQuery to load in IE7, works fine in all other browsers, firefox,safari,opera,ie8 just not in IE7. If anybody has any sort of idea why, please do let me know. Many Thanks, Q This is before the <script src="js/jquery.js" type="text/javascript"></script> <script src="js/plugins.js" type="text/java...