wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes problem with < script  > tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "problem with &lt script  &gt tag" Watch "problem with &lt script  &gt tag" New topic
Author

problem with &lt script &gt tag

rachana ravali
Ranch Hand

Joined: Jun 20, 2006
Posts: 32
hi,
i am trying to print the first column of the table using the following condition:
If the javascript is enabled it should be displayed as link and if it is disabled

then it should appear as readable only text.

But when i am tring to write a hyperlink inside the <script> tag ,the datalink is not

getting displayed in that column,when the javascript is enabled.
<td>
<script>
<a href="javascript opUp('a window opens')"><nested:write property="serialId" /></a></td></script>
<noscript><nested:write property="serialId" /></noscript>
</td>

When it is disabled it is going into <noscript> and the data is displayed.
Can any one please suggest me the right way of doing it ?
thanks in advance
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You have an extra td in your code

You would want to use document.write

<script>document.write("<a href='#'>foo</a></script>

Eric
rachana ravali
Ranch Hand

Joined: Jun 20, 2006
Posts: 32
Thanks Eric.
 
jQuery in Action, 2nd edition
 
subject: problem with &lt script &gt tag
 
Similar Threads
Need help selected text fields visible for particular option from drop down list in JSP(struts)
Post date is not shown
validation problem
To test if java script is enabled in client browser or not
Checking browser version & JavaScript enabled