473,386 Members | 1,708 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Linking Documents

12
Hi,

I want to use a variable declared in one .htm document in another .htm document. I am using javascript.

Is this possible?

Many Thanks.
May 29 '07 #1
3 1059
acoder
16,027 Expert Mod 8TB
This depends. How are you linking the documents?

You could pass a variable in the url to the next page and use the location.search property to get the variable.
May 29 '07 #2
shimant
12
This depends. How are you linking the documents?

You could pass a variable in the url to the next page and use the location.search property to get the variable.
acoder, thanks for your response.

Basically, this is what I intend to do:

Report1.htm

<html>
<head>
<script language = javascript>
var ReportName = 'MaturityReport.htm';
</script>
</head>

</html>

Now, in ShowHistory.htm, I want to pick up the value of the variable, ReportName (which is declared in Report1.htm)

ShowHistory.htm
<html>
<head>
</head>
<body>

document.write("<a target="+"ReportWindow"+" href='"+ReportName+"'>Show Report</a>");

</body>
</html>


The reason I want to pass the ReportName to ShowHistory.htm is because, there will many .htm files like Report1.htm, Report2.htm etc. and each will have a different value for the ReportName variable.

So, I want to create a generic ShowHistory.htm which picks up the ReportName from those .htm files (i.e .Report1.htm, Report2.htm etc.)

Any idea acoder?

Thanks a lot.
May 30 '07 #3
acoder
16,027 Expert Mod 8TB
Is there no chance you can change Report1, Report2, etc.?

Unless you were only showing a basic example and they actually contain more stuff, you would be better off changing them into .js files with just one line.

Then it would be easy to access the variables by including the script using script tags.
May 30 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: perturbed | last post by:
Hi people, I was wondering if anyone could offer me some advice. I'm building a database of XML documents using eXist (which seems pretty good so far). I can create, store and search individual...
1
by: c duden | last post by:
Excel won't allow documents to be linked to a worksheet in office 2000 when using C# to create an add-in. The following code snippets are what was used in the attempts (there are more...
2
by: sunil | last post by:
Hi, We have lot of c and fortran archive libraries that have complex dependencies. We have different server tasks that use some of these libraries. We have developed a tool inhouse that links...
3
by: Thomas Ruschival | last post by:
Hi, as far as I know I can link all C libraries in C++ as well. but I can't get it done with pslib. pslib is a library to create Postscript documents. The exactly same code compiles and links...
3
by: Stephen Gray | last post by:
Hi, What I'm trying to do is produce a number of XML documents that can be linked together. For example say I had one document called "valuations.xml" which is a lists all of the...
2
by: Tony Williams | last post by:
I have two tables one lists the names of committees and the other is a list of documents they generate. I have a form based on the documents table which gives details of the document including...
2
by: Matthew Wells | last post by:
Good morning... I have an Access front end that uses SQL Server linked tables. SQL Server uses Windows authentication. I have one Windows group that all Access users are a member of. I added...
0
by: Steve McLellan | last post by:
Hi, Was wondering whether there's any more info on why the project I'm working on might not be able to link incrementally... as deadlines approach, waiting 3 minutes each link is not what I...
2
by: watto | last post by:
I have a large database application with user data in a backend and forms, code etc in a frontend. It includes a facility for migrating data from an earlier backend to the current backend by...
4
by: naveenmurthy | last post by:
Hello All, I have created a .mht file in following format. 1. The .mht file contains following htmls. a. MHTLinkingProblem.html b. Left.html c. Right.html d. Start.html
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.