I'm allowing a user to assign a computer to a software license and I use ajax to pop up a modal to facilitate that assignment. After the ajax completes I use javascript to create a href tag using the returned id(s) to create a link and I add it to the table showing the assigned computers. The links on page refresh or when you go there show as localhost:8080/assets/details/?id=510
, but the links being created by javascript are coming out as localhost:8080/licenses/details/asseets/details/?id=510
. The URL bar at the top is localhost:8080/licenses/details/?licenseid=80
so that's why the javascript created ones are directing to the licenses controller instead of the assets controller.
Anyway I can adjust my javascript code to fix this?
success: function (data) {
for (var i = 0; i < data.length ; i++) {
var row = [
'<input value="'+data[i].id+'" />'
, '<a href="assets/details/?id=' + data[i].id + '">' + data[i].name
, data[i].manufacturerItem.serialNumber];
table.fnAddData(row);