Question: how to call change ajax url based on response

```
$.ajax({
    url: "/url/1/1",
    dataType: "json",
    success: function (response) {
        if (response) {
            // i want to change url based on response
            //example var next = response.next    
            // den i want to call url as /url/1/next.
        }
    }
});

```

Answer: 
You can use the [Javascript Executor](http://selenium.googlecode.com/git/docs/api/java/org/openqa/selenium/JavascriptExecutor.html)

```
WebDriver driver;
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("document.querySelector('<CSSLOCATOR>').setAttribute('width', <WIDTH>)");

```

where you fill in `<CSSLOCATOR>` and `<WIDTH>` with what you need.
If its static table then we can add attirbute (not setAttribute, because we need to add new attributed 'width') 'width' with that tag.

```
String tableJS = "document.getElementsByTagName('table')[0].style.width='1000px'";
js.executeScript(tableJS);

```

Note: If cell OR table width is handled by external CSS then this may not work.

2nd Way:If we have resizble table, then we can find the element of 'resizer' and apply below solution by using Action class:

```
if (resizeableElement.isDisplayed()) {
            Actions action = new Actions(driver);
            action.clickAndHold(resizeableElement).moveByOffset(100, 100).release().build().perform();
        } else {
            System.out.println("Element was not displayed to drag");
        }

```