SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Sep 2006
    Posts
    145
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy Script broken in IE/Win 6/7

    Hello there,

    It's not a terribly important script as the web page still functions without it, but if anyone could help me out with this I would be SO grateful.

    http://www.interactiverichard.co.uk/...que-dignissim/

    If you type something in any of the 'reply' input fields, it will appear in real time in a preview comment that fades in scriptaculously. This is to let user see what something will look like before they post it, and to make a good impression for anyone looking to hire me! Unfortunately, this only works in Firefox, Safari, Opera and probably many others, but isn't run at all in IE/Win 6/7.

    I'm surprised that this doesn't run in the latest revision of the IE browser... this is slightly disappointing.

    Is there something I can do that will make the script run on IE/Win?


    Thanks in advance for any help!

  2. #2
    SitePoint Addict ALL's Avatar
    Join Date
    Oct 2005
    Location
    South Dakota
    Posts
    215
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    well i just ran it in IE and i debugged it for you and it is erroring on this line:

    Code:
    	document.getElementById('commentPreviewArea').innerHTML = '<li class="commentpreview_bubble" id="comment1"> <div class="commentpreview_bubble_content"> <div class="commentpreview_bubble_content-text">'+preview_comment+'</div> <div class="commentpreview_bubble_content-metadata">From '+preview_link_open+preview_author+preview_link_close+' on December 11th, 2006.</div> </div> </li>';
    HTML 101... never create a child tag without createing the parent first...

    <li> is a child of <ul> you MUST create a ul tag to create an <il> tag. you must always use unique ids when createign an element. You are should also not use - (hyphens) in ids only 1-9a-z and _

    so in other words it shoud look like this:
    Code:
    	document.getElementById('commentPreviewArea').innerHTML = '<ul><li class="commentpreview_bubble" id="comment-"> <div class="commentpreview_bubble_content"> <div class="commentpreview_bubble_content-text">'+preview_comment+'</div> <div class="commentpreview_bubble_content-metadata">From '+preview_link_open+preview_author+preview_link_close+' on December 11th, 2006.</div> </div> </li></ul>';
    Did I help you?
    You can repay me, support one of my projects (no money needed):
    JavaScript Wiki, Another Web Forum, Paranormal Site

  3. #3
    SitePoint Zealot
    Join Date
    Sep 2006
    Posts
    145
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, I've updated the script. Cheers for your help, I'll remember your advice for the future!
    Last edited by richardhenry; Dec 11, 2006 at 19:24.


Bookmarks

Posting Permissions

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