I'm using jCarousel to load items from a text file dynamically. But I wanted to add an link depending on the image id to the carousel so I'm using regex to work out the image filename and going from there. It all works fine, however I'm getting the following error:
TypeError: Cannot read property '1' of null [http://localhost:64479/TestPage_ToolTips.aspx:71]
Line 70 and 71 are:
var testRE = url.match("t_(.*).jpg");
return '<a href="viewprofile.aspx?id=' + testRE[1] + '"><img src="' + url + '" width="75" height="75" alt="" /></a>';
I'm guessing the error is with testRE[1] - however it is working properly in the html when it loads the page. I just don't want a javascript error on the page.
Thanks