Question: I am trying to get data from a php sub-page.
Using javascript, I have tried to use :

```js
var items = document.querySelectorAll('option');
console.log("length : "+items.length);
```

```html
  <option value="75">item-127 ( 120127 )</option>
  <option value="74">item-163 ( 0 )</option>
  <option value="94">item-139 ( 0 )</option>
  <option value="89">item-135 ( 0 )</option>
  <option value="369">Item-AC95 ( AC95 )</option>
  <option value="63">item-159 ( 120159 )</option>
```

But it does not return the expected length:
length : 0
How could I do it?

The final expectation is having a table with values and items

thanks

Answer: 
It's error because of 

> 
> The expected message formats for the operation are 'Xml', 'Json'.
>  So you can pass contentType in your ajax call
> 
> 
> 

```
$.ajax({
 ....,

  contentType: "application/json"
})

```
```
$("body").on("submit", ".example_form", function() {
$.ajax({
    url: 'http://example.com/{ROUTE_URL}',
    data: new FormData(this),
    processData: false,
    contentType: false,
    /* OR contentType: "application/json; charset=utf-8"*/
    type: 'POST',
    dataType: "json",
    success: function(data) {
        console.log(data);
    }
});

```

});