#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    Singapore
    Posts
    5
    Rep Power
    0

    Quick question about javascript syntax


    Hi,

    Is there any betterway than, <script language=javascript>document.write(variable);</script>

    I want to display parameter value, like what we do in JSP, <%=variable%>.

    thanks,

    Mani
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    May 2003
    Posts
    1,014
    Rep Power
    15
    It depends on what you want to do...
    If you like to see your variable inside a div, you could also use DOM methods like:
    document.getElementById("mydiv").innerHTML = myvariable.
    If your question is 'is there a syntax like <%= ', the answer is no.

    Hope this helps,
    Jeroen

IMN logo majestic logo threadwatch logo seochat tools logo