473,326 Members | 2,102 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,326 software developers and data experts.

link help

sir

I have html page a that have a link to page b.

Page b are very similar to page c and d,except some fields so I would like
to combine them as Page common.html.

Can I pass the parameter from page a.html so that the parameters can
determine which fields to be displayed in common.html?
Jul 23 '05 #1
1 1912
In article <K9bMd.253012$8l.44142@pd7tw1no>,
"timothy ma and constance lee" <ti******@shaw.ca> wrote:
sir

I have html page a that have a link to page b.

Page b are very similar to page c and d,except some fields so I would like
to combine them as Page common.html.

Can I pass the parameter from page a.html so that the parameters can
determine which fields to be displayed in common.html? The first file includes a little other stuff, but it does show you how
to pass a parameter. robert

How to pass a parameter:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Read variables</TITLE>

<SCRIPT type="text/javascript">

function foo()
{
var theData, newWindow, URLstring;
//You can pass around 2k of data.
theData = "?data=" + escape("boldparagraph");
URLstring = "readVars.html" + theData;

newWindow = window.open(URLstring,"Printable",
"statusbar,menubar,resizable,toolbar,height=600,wi dth=800");
newWindow.focus();
}
// ------------------------------------------

// This function takes a Node n, replaces
// it in the tree with an Element node
// that represents an HTML <b> tag, and
// then makes the original node the
// child of the new <b> element.

// From: javascript: The Definitive Guide by David Flanagan

function embolden(node)
{
var bold = document.createElement("b");
var parent = node.parentNode;

parent.replaceChild(bold,node);
bold.appendChild(node);
}
</script>

</HEAD>

<BODY onload='
alert("bold text next");
embolden(document.getElementById("inlineparagraph" ));
alert("Try to open a new window next.");
foo();
//alert("Tried to open the window.");'>

<p><br>Lets open a window and pass data to the window.</p>
<p id="inlineparagraph">A Javascript function in this file
will bold <i>this</i> paragraph.</p>
<p id="boldparagraph">A Javascript function in the call html file
will bold this paragraph <i>is</i> paragragh.</p>

</BODY>

</HTML>

How to read the parameter:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Read passed data</TITLE>

<SCRIPT type="text/javascript">
var theData;

function foo2()
{

var begin;

begin = location.search.indexOf("data=");

if (begin >0 )
{

theData = location.search.substring(begin+5,location.search. length);
theData = unescape(theData);
document.write("<p>Here is the passed data:</p>");
document.write(theData + "<\/p>");
}
else
{
document.write("Could not find passed"
+ " variable \"data=\" with escaped data.")
}
}
</script>

</HEAD>
<BODY onload='
alert("bold text in opener document");
opener.embolden(opener.document.getElementById(the Data));'


<p>What is the deal?</p>
<SCRIPT type="text/javascript">
document.write("<p>");
foo2()
document.write("<\/p>");
</script>
</BODY>

</HTML>
Robert
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: timmy_dale12 | last post by:
I need help with this one. I have a function that pastes a row. In each row i am pasting a link which is to call a date picker javascript function. This is the code that pastes the link : link =...
1
by: Unregistered | last post by:
I'm making an Intranet site for someone who is not very familiar wit making websites, thus I would like to make it as simple as possible fo her when she needs to update it. The intranet site...
7
by: Shawn Windle | last post by:
----begin node.h-------- #ifndef NODE_H #define NODE_H #include <iostream> //NULL using namespace std; class node {
22
by: Rudy Ray Moore | last post by:
Why is "Visual Studio .net 2003 7.1 c++" so much slower than VS6 at linking? It looks like "Visual Studio .net 2003 7.1 c++" doesn't even do incremental linking! I make one very minor change in...
14
by: Steve McLellan | last post by:
Hi, Sorry to repost, but this is becoming aggravating, and causing me a lot of wasted time. I've got a reasonably large mixed C++ project, and after a number of builds (but not a constant...
0
by: Luis E Valencia | last post by:
Read from above to top. I didnt understand. This is the code that fills that datagrid Public Sub pasar(ByVal sender As System.Object, ByVal e As...
2
by: Mitul | last post by:
Hello friends, I need some help for link redirect. I am currently working with a b2b site. I had define some rules in htaccess but due to auto append of PHPSessionID at the end of link I could...
17
by: HornyLaBelle | last post by:
I'm hiding the email address on a website with this javascript which works fine: --------------------------------- <p>Send your comments and questions to our <script language=javascript> ...
8
by: Amy | last post by:
Hello this script was switched to one with a timer. But now it doesn't work right. The items in the left are supposed to be the link names, and the items in the right are supposed to be the link...
11
by: yangsuli | last post by:
i want to creat a link when somebody click the link the php script calls a function,then display itself :) i have tried <a href=<? funtion(); echo=$_server ?>text</a> but it will call the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.