I am having problem in the below code,
MyConfig.js (this is an external js file)
function myFunction()
{
var tfile = "file://";
// Server Location(should be changed at the time of deployment)
var location = "inhyds149";
// Document folder location. The user documents will be pulled from here.
var staticpath = "/Documents/pdfs/";
var n=tfile.concat(location,staticpath);
return n;
}
My HTML content ::
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Adobe RoboHelp 10" />
<title>Third</title>
<link rel="StyleSheet" href="default.css" type="text/css" />
<script src="D:\Test\MyConfig.js" type="text/javascript"/>
</head>
<body>
<script>
function myFinal()
{
var tfile1 = myFunction();
var location1 = "Holidays 2013.pdf";
// Document folder location. The user documents will be pulled from here.
var n1=tfile1.concat(location);
return n1;
}
</script>
<h1>Third</h1>
<p>Dynamically hyperlink pdf to <span style="font-weight: bold;">'welcome'</span>
keyword</p>
<p> </p>
<p><a id="Link" onclick="myFinal()" target="_blank">Welcome</a></p>
</body>
</html>
My requirement is to concat the result which I am getting from the external js file with the value in location1 in my js file and feed it to on click . Please help .
Actually requirement is I need to generate a location dynamically . SO the external JS function will contain a part of the path and the internal JS function will contain the remaining . I just want to concat both of them and open that PDF. So it will be myFunction will return say : //abc/xyz And I will have a string in my html and I have to merge them say : //abc/xyz/l.pdf I just want to open this pdf