Results 1 to 2 of 2

Thread: Javascript Questions

  1. #1
    Join Date
    Nov 2007
    Posts
    4

    Question Javascript Questions

    I have an area on a website I am developing that I would like a deal of some sort to display in. I want it so that when you change the deal, it will change on every page instead of just the one you edited. So, I created a .js file that I stored the text in and hoped it would write it to the screen so I can just change it once. In the actual HTML doc I have:

    HTML Code:
    <script language="JavaScript" src="deals.js"></script>
    The 'deals.js' file says:

    Code:
    var txt = "<B>New!<B> - Skil Digital Angle Finder - <font color = "red"><b>$49.99</b></font> - <font color = "black"><a href="blah">More</a></font>"
    document.write(txt)
    My javascript skills are very rudimentary, and because so, this doesn't work and I don't know why. Any suggestions?

    EDIT: Upon debugging I found that I cant have <font color = "red"> tags or stuff like that because of the "". I don't even know if the <b> tags work. Is there a way around this?

    -TheAngryTomato

  2. #2
    Join Date
    Sep 2005
    Location
    Mid Wales, UK
    Posts
    68
    Try using single quotes instead. This often solves a lot of problems with JavaScript.

Similar Threads

  1. Javascript - online test creation
    By johndouglas in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 1
    Last Post: 13 Oct 2007, 07:52 AM
  2. element specific javascript
    By gumbo in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 0
    Last Post: 04 Dec 2005, 06:25 PM
  3. element specific javascript
    By gumbo in forum Web Design, HTML Reference and CSS
    Replies: 0
    Last Post: 04 Dec 2005, 06:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •