Q:

Var value breaks on url format

I have an url as a var, from a div with data:
<div data="$firstID-$secondID-$url">

Then we split 'data':
ids = ids.split('-'); var firstID = ids[0]; var secondID = ids[1]; var url = ids[2];

I open it with:
window.open(url, 'opener');

That all works fine, except that the link contains all these characters, and stops at 'http://domain.com/word':
http://domain.com/word-word/Product/show/name-name-name-name-(name-name)/case{id-id}

How can I pass this insane link as var to the 'window.open' and still in tact?

A:

ids = ids.split('-');

//get rid of first 2 parts
var urlParts = ids.slice(2, ids.length)  

// join the remaining parts back
var url =  urlParts.join('-')

