简体   繁体   中英

string concatenate in Html anchor tag

I created cluster.js file and inside that one base url variable created ex.

var path ={
  projectName:"http://localhost:8080/UniconnectConfigurationWeb"
};

Now i want to set path.projectName whenever i need to use this basic url instead to write whole url. But problem is when i concatenate path.projectName with "/cluster" following unexpected url link open. ex. http://localhost:8080/UniconnectConfigurationWeb/path.projectName+%22=/cluster%22 .

How can i concatenate base url with some string in html/jsp anchor tag.

用这个

<td class="formtext"><a href="http://localhost:8080/webtop/drl/objectId/'"+object_id+"'>View</a></td>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM