This function creates a series of links at a desired destination by the usage of a premade tag system.
Usage:
createMyTAGS_DATA
pass in a single line all the links as: LinkText;LinkAddress;;
createMyTAGS_LOCATION
pass the destination to a div
,span
,... to render the result.
createMyTAGS_DATA
passes in a single line of all the links as:LinkText;LinkAddress;;
createMyTAGS_LOCATION
passes the destination to adiv
,span
,... to render the result
Result would be:
<a href="LindAddress1">LinkText1</a><a href="LindAddress2">LinkText2</a> [...]
Note: each of tag(LinkText;LinkAddress;;)
must have more than 10 characters.
<span onclick="createMyTAGS('LinkText1;LinkAddress1;;LinkText2;LinkAddress2;;','renderHERE');" style="cursor:pointer;"><b>click here</b></span>
<div id="renderHERE"></div>
<script>
function createMyTAGS(createMyTAGS_DATA,createMyTAGS_LOCATION){
try{ var linkTags = createMyTAGS_DATA;
var v1 = createMyTAGS_LOCATION;
while (linkTags !== '' && linkTags.indexOf(";;") > 10){
var linkNew = linkTags.slice(0, linkTags.indexOf(";;"));
var linkText = linkNew.slice(0, linkNew.indexOf(";"));
linkTags = linkTags.replace(linkNew+';;', '');
linkNew = linkNew.replace(linkText+';', '');
linkNew = '<a href="'+linkNew+'" title="'+linkNew+'" target="_blank">'+
linkText+'</a> ';
document.getElementById(v1).innerHTML =
document.getElementById(v1).innerHTML + linkNew;
}
}catch(err){alert('createMyTAGS: '+err.message+
'; - statement('+createMyTAGS_DATA+','+createMyTAGS_LOCATION+')')}
}
</script>