unobtrusive-javascript Questions

3

Solved

I'm using the following code in my rspec test: describe "Save should create a BasketItem and a Basket" do subject { lambda { click_button I18n.t(:create_basket_and_add_items) page.driver.br...

17

Solved

What are the differences between JavaScript's window.onload and jQuery's $(document).ready() method?
Hollandia asked 13/9, 2010 at 6:24

9

Solved

In my rails app I have a remote form that looks something like this for example: <%= form_tag some_path, :method => :get, :id => 'my-form', :remote => true do %> <%= text_field_...
Frazzled asked 20/12, 2011 at 4:31

6

Solved

What is the difference between obtrusive and unobtrusive javascript - in plain english. Brevity is appreciated. Short examples are also appreciated.
Tried asked 5/12, 2011 at 21:50

9

It is always recommended to avoid inline Javascript codes by putting all codes in a JS file, which is included in all pages. I wonder, if this does not cause performance problem in heavy pages. Fo...
Redound asked 25/9, 2013 at 10:41

3

Solved

I want to call a javascript function that will be conditional upon a user's response to the confirm box. For example, I have the following anchor: <%= link_to 'Sign Out', destroy_session_path,...

4

Solved

I have an expensive form action that builds a zip file on the server and returns it to the browser. <form action='/download' method='post'> <input type='submit' value='download'/> &...
Fix asked 23/11, 2012 at 13:4

6

Solved

In Rails 3, passing a :confirm parameter to link_to will populate the data-confirm attribute of the link. This will induce a JS alert() when the link is clicked. I am using the rails jQuery UJS a...
Moradabad asked 12/12, 2010 at 9:49

2

Solved

I need a reference list of all unobtrusive validation attributes for each Validation Attribute. Something like:

6

Solved

I've got a JavaScript application that uses a lot of callbacks. A typical function will take a callback, and wrap it with another callback. Namespace.foo = function( arg, their_on_success ) { var...
Adultery asked 19/10, 2011 at 17:46

23

Solved

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off. This happens on p...
Zobias asked 14/10, 2008 at 23:25

3

Solved

I'm trying to add the asynchronous version of the Google Analytics tracking code to a website. I'd like to keep the JavaScript in a separate file, and call it from there. Here's what I've current...

6

Is there a way to find a clients location on a website using just jQuery. For example, if a user comes to my site, how could I find out what their approximate location is just using jQuery. F...
Roughneck asked 5/1, 2013 at 23:39

4

Solved

It seems that kendo's unobtrusive-javascript style event calls break this in my method context. Say I have an object Foo, instantiated as bar = new Foo() function Foo(){}; Foo.prototype.name = "...
Earthenware asked 29/12, 2012 at 13:14

4

Solved

jQuery Validation makes it simple to validate an email address: $("someForm").validate({ rules: { SomeField: { required: true, email: true, remote: { type: "POST", url: "CheckEmail" } } ...

5

Solved

I've recently got up to speed with Knockout and I think it's a fantastic framework. However I have one concern. I'm finding that in non-trivial binding cases, I have snippets of javascript code cr...
Smallpox asked 19/11, 2012 at 9:59

3

I have an ASP.NET MVC project where I want to post an article to the database then display a snippet of the article on the page. When a user comments, I also want to display the comment once I have...
Darrelldarrelle asked 26/9, 2015 at 14:26

3

Solved

The following markup generates an input of type checkbox with an id="IsRecurring" when a Razor view is sent to the browser. <div class="editor-label"> @Html.LabelFor(model => model.IsRec...
Dungdungan asked 27/1, 2012 at 1:56

7

Solved

I have a create form to create an object. The create model has some properties that are only visible (.hide, .show()) if a checkbox is checked and that are marked required (by Attribute in Model). ...

3

Solved

I'm using jQuery Validation Plugin, v1.11.0,2/4/2013 with jquery.validate.unobtrusive.js. I guess I face a bug of Range validation for numeric field: Validation compares String value with String o...

2

Solved

I have two regex that I need to join into one as I am using the RegularExpressionAttribute in ASP.NET and it does not allow multiple instances. How can I join the following two regex into one? .*...
Snowy asked 23/4, 2015 at 7:31

1

Solved

Let's say I have this model: public class Person { public bool IsApproved { get; set; } } And whis this codes, I am trying to render input with check type: @Html.CheckBoxFor(x => x.IsApprov...
Flexuous asked 14/3, 2015 at 10:36

7

I've been trying to get MVC Jquery unobtrusive error handling working with twitter bootstrap for some time now. Its got to the point were i'm either going to edit jquery.validate or do some hack an...

3

Solved

I can't seem to use jQuery Accordions with definition lists that have multiple desciption items (dd). The author's examples have only single dd items. In the example below B2, B3 & C2 show onL...
Mcglynn asked 4/8, 2010 at 10:36

6

Solved

I'm trying to implement the code as mentioned in this post. In other words I'm trying to implement unobtrusive validation on a terms and conditions checkbox. If the user hasn't selected the checkbo...

© 2022 - 2024 — McMap. All rights reserved.