Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > placing text

Reply
Thread Tools

placing text

 
 
Philip WATTS
Guest
Posts: n/a
 
      07-15-2003
Can anyone help a beginner?
I am trying to set up a situation where by activating a link, a text phrase
above the link changes.
I am calling a function that uses a document.write statement, but the text
is shown in a new window (replacing the current one) rather than on the same
page.
The code is below.

Thanks for your time

Phil

<HTML>
<HEAD>
<SCRIPT language="JavaScript">
text=new String
start=new String
one=new String
two=new String
text="initial text value"

function phase1(){
text="phase one text from function"
document.write(text)
}
function phase2(text){
text="phase two text from function"
document.write(text)
}
</script>
</head>
<body>
<div name="texthere"> Text is supposed to go here</div>
<script language="Javascript">
document.write(text)
</script>

<a href="java1.html#" onClick="phase1()">link1</a>
<a href="java1.html#"onClick="phase2()">link2</a>


</body>
</html>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Placing the selection of a list field in a text field Jerry Manner HTML 5 06-09-2005 01:52 PM
Placing the form tag within dynamically generated text... Stu ASP .Net 4 01-06-2005 03:31 PM
Placing of Pictures next to text. James Smith HTML 2 08-12-2004 11:26 AM
Placing photo and text with CSS. Luigi Donatello Asero HTML 1 01-06-2004 10:45 PM
placing text at point on console bart Python 1 07-01-2003 08:47 PM



Advertisments