I'm getting the following result through ajax.
row=Shimla|1|http://vinspro.org/travel/ind/
I wanna http://vinspro.org/travel/ind/ from it. I have used find and split function but it is not working . please let me know how I can get it?
var result=$(row).split('|');
alert(result);
chrome showing the following error
Uncaught Error: Syntax error, unrecognized expression: Shimla|1|http://vinspro.org/travel/ind/
split('|')will create 3 strings inside zero-index based arrayresults, in which the url you want is the 3rd, so you wanna doalert(result[2])$(row).val().split('|')...But the fact is that functions such as$(row).val()or$(row).text()are applicable for DOM elements only. This is a variable that as you indicated is coming from an AJAX response. There's absolutely no need to use jQuery for this since it's just string manipulation already available through vanilla JavaScript. Just dorow.split('|')[2]as indicated by TJsplitmethod. The sytax error is given by the fact that OP didn't put quotes around string. I wonder why nobody mentioned it