how to embed HTML code into the javacript codes ?

Discussion in 'HTML & Website Design' started by a_fazlani, Oct 18, 2009.

  1. #1
    when i want use some html codes into the some scripts, then it doesn't work or visitor just see source of HTML that i inserted! no its effect ... :(

    sample problem:
    <script type="text/javascript">
    		            var sayHello = new LiveValidation('sayHello', { validMessage: '<br/><a href="index.html"><img src="hello.jpg" border="0" valign="bottom"></a>', wait: 500});
    		            sayHello.add(Validate.Presence, {failureMessage: "test"});
    		            sayHello.add(Validate.Format, {pattern: /^hello$/i, failureMessage: "test" } );
    </script>
    Code (markup):
    do i need use document.write to cover HTML codes ? then its working ?
     
    Last edited: Oct 18, 2009
    a_fazlani, Oct 18, 2009 IP
  2. a_fazlani

    a_fazlani Peon

    Messages:
    146
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    nobody know?!
     
    a_fazlani, Oct 18, 2009 IP
  3. MhW

    MhW Active Member

    Messages:
    370
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    85
    #3
    MhW, Oct 18, 2009 IP