Trying to take a string like such girls shoes,http://www.myshoestore.com/girls.html;boys shoes,http://www.myshoestore.com/boys.html;mens shoes,http://www.myshoestore.com/mens.html etc... I want to split the words before the comma (,) and use that as the anchor text. I want to then split the words between the comma (,) and the semi ( and use that as the URL. I then want to loop through the results. I could use something like.. var str="Nice Shoes"; Response.Write(str.link("http://www.myshoestore.com")); ... and just loop through it, adding 1 to the variable name. I just cant understand how to split that string twice and place the items properly. Any help? Big thanks!
Solution in VBScript, because I am rusty in JScript! Dim strVariable strVariable = "girls shoes,http://www.myshoestore.com/girls.html;boys shoes,http://www.myshoestore.com/boys.html;mens shoes,http://www.myshoestore.com/mens.html" Dim arrURLs Dim arrNameValue arrURLs = Split(strVariable, ";") For i = 0 to UBound(arrURLs) arrNameValue = Split(arrURLs(i), ",") Response.Write "Text:" + arrNameValue(0) + " URL: " + arrNameValue(1) Next
Couldnt get it to work in JScript... so I did a VB runat server and set a session. Its a chop, but it works great. Thanks for the help guys!