This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with &lt script &gt tag

 
rachana ravali
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Eric.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic