User Profile

Collapse

Profile Sidebar

Collapse
Humphrey Shires
Humphrey Shires
Last Activity: Jul 29 '12, 07:23 PM
Joined: Oct 14 '11
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Hi gits, I've now replaced the text(between the 's in the alert box) with a variable. Had problem getting this to work until I entered the variables in the <script> section of the page <head>. I couldn't use double quotes in your example because all this snippet was inside a set of doubles to produce a row of a table. The project is for in-house so whatever works without bringing down the ceiling should be OK. The \\n works in the text...
    See more | Go to post

    Leave a comment:


  • Many thanks gits but that doesn't work, the problem is how html reads the script passed over from js - but I've now sussed it (after a few hours) -- the \n needs an escape in front of it ie \\n.
    Posted for others is the part of document.write that applies (note the quotes):
    "<table><tr><td ><a href onclick=alert(' Some&nbsp;list\ \nhere')>The list</a></td></tr></table>"....
    See more | Go to post

    Leave a comment:


  • line breaks in alert box from html script

    I'm building an HTML page with javascript. All is fine in the document.write until I want to create an alert box from an onClick on the page.
    Here's the script(part) so far:"<td><a href onclick=alert(' Some&nbsp;list& nbsp;here')>The list</a></td>".
    This brings back alert box with - Some list here - OK but I want a line break where the second &nbsp; is. I've tried all the \n \r <br>...
    See more | Go to post
No activity results to display
Show More
Working...