FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Javascript help plz

 


TheMasterCheaif
Code:
 How do you call a varible into text in javascript i can do it in php but java script wont work her's what i got
 
 
 
 <html>
 <body>
 
 <script type="text/javascript">
 name = "Jacob"
 rank = "white rabit"
 work = "Matrix"
 document.write ("Myname is name I am rank rank I am part of the work" )
 
 </script>
 
 </body>
 </html>


ok it just shows as
Myname is name i am rank i am part of the work

When i want it to show the varibles instead of just name, rank, work

so why wont it work(that s the entire code first java script)
TheMasterCheaif
nvm i got it and to the peaple out there who wante dto know how also what you have to do is put addition and double quote marks in as shown

Code:

name = "mom"

document.write (Hello " + mom + " its me agin)
varun_dodla
TheMasterCheaif wrote:
nvm i got it and to the peaple out there who wante dto know how also what you have to do is put addition and double quote marks in as shown

Code:

name = "mom"

document.write (Hello " + mom + " its me agin)


Hey!! don't you think it should be

Code:

name = "mom";

document.write ("Hello " + name + " its me again");
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.