MShack
MShack

Reputation: 652

link to image not directing to correct url

I am replacing some text with images , which are working fine , but i've added a link for the new images and for the life of me can't get it to directing correctly

.html( '<a href="window.baseURLDynamic' + '/' + window.year + '/options?L=' + window.league_id + '&F=' + fdb.id + '&O=7">' + '<img src="' + fdb.icon + '"class="franchiseicon" /></a>' );

The images are located on this url - http://www20.myfantasyleague.com/2014/home/74656

and i want the script to link to this url - http://football20.myfantasyleague.com/2014/options?L=74656&O=07

but my script is breaking the link and i'm getting this instead - http://www20.myfantasyleague.com/2014/home/window.baseURLStatic/2014/options?L=74656&F=0007&O=7

Upvotes: 0

Views: 31

Answers (1)

iCollect.it Ltd
iCollect.it Ltd

Reputation: 93571

You have window.baseURLDynamic as a hard-wired string instead of accessing the property value.

Try:

.html( '<a href="' + window.baseURLDynamic + '/' + window.year + '/options?L=' + window.league_id + '&F=' + fdb.id + '&O=7">' + '<img src="' + fdb.icon + '"class="franchiseicon" /></a>' );

Note: Where are you getting baseURLDynamic from, as that is not a normal client-side property of window? I am assuming you are setting that previously, else this will not work anyway :)

Upvotes: 1

Related Questions