Question: I have developed a website for PC using asp.net MVC5. Now trying to develop a mobile supported anonymous access web page for same website using asp.net MVC5. I created a new project for this and downloaded jQuery.Mobile.MVC from Nuget console. This added mobile layout in the project with the JS code 

```js
$(document).ready(function () {
    $.mobile.ajaxEnabled = false; 
});

```

I just added a new view with this mobile layout and added few label controls to see how it works. It throws below error

JavaScript runtime error: Unable to set property 'ajaxEnabled' of undefined or null reference

Do I have to add any other libraries? This is my first mobile page. It would be great if you are help with some good tutorials

I have included jquery.mobile.js references

Thanks

Answer: 
This is a security feature that lets libraries use strings and wrappers for primitives in collections or otherwise without making "defensive copies".

If users were allowed to derive their own values, say, from `Integer`, they could make a mutable version of it. Then they could pass instances of this `Integer` to a library that expects a collection of `Integer`s, like this:

```
class ApiClass {
    private final List<Integer> intList;
    ApiClass (List<Integer> ints) {
        // Make a defensive copy
        intList = new ArrayList<Integer>(ints);
        // Go through the list, and check the values
        ...
    }
}

```

Currently the constructor should make a defensive copy of the collection, but a shallow copy is sufficient, because `Integer`s inside cannot change. If Java did not insist on `Integer` being `final`, however, there would be no such guarantee, so the code would have to make a deep copy. Otherwise the caller could construct `ApiClass` by passing valid `Integer`s in a list, and then go through that list of `MyInteger`s, and change their values to what the constructor would consider invalid. This would break assumptions of other methods inside `ApiClass`, potentially causing crashes or exposing information that the "plain" `Integer` would not leak.
Sorry for this, activating this thread 5 years after, but i can't see any constructive suggestion for a solution - why don't you simply encapsulate it?

```java
public MyInteger {

  private Integer value;

  public MyInteger(Integer value) {
       this.value = value;
  }

//... Add your custom math methods here

}

```

Leaving this here if someone stumbles on this with similar questions :)