I have three links :
"http//example.com/product/iphone?source=ac"
"http//example.com/product/samsung?source=tz"
"http//example.com/product/sony?source=sn"
I want to split the string to get two variables like so:
var link1 = 'http//example.com/product/iphone';
var link2 = '?source=ac'
// The others are similar
//var link1 = 'http//example.com/product/samsung';
//var link2 = '?source=tz'
//var link1 = 'http//example.com/product/sony';
//var link2 = '?source=sn'
Please give me your opinion, and help me in this case, I'm really new to javascript. It was difficult. Thank you everyone