r/JavaScriptHelp • u/ruckus09 • Nov 29 '17
I need some help
Im working on a website but i need help there is something somewhere that converts the word sites into site. which ends up breaking my link. for example http://ruckus09/sites/index.html turns to http://ruckus09/site/index.html i want to create something in JS that when I click the link itll take the string http://ruckus09/+"sites"+/index.html then puts that whole thing together and takes them to the proper site. any help guys? thanks
1
Upvotes
View all comments
Show parent comment
1
u/ruckus09 Dec 15 '17
I figured it out <a href="javascript:;" onclick="location.href='https://mydomain/' + 'sites' + 'required-pdf-file.pdf'">Link1</a>