SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Thread: This IE thing

  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2005
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    This IE thing

    I'm not exactly sure what the problem is, but I'm posting it here.

    I'm using this collapsable div script from harry maugans:
    http://www.harrymaugans.com/2007/03/...cript-and-css/

    I don't much understand it, but copy and paste has worked fine for me so far.

    That is... in everything except for IE.

    Here's what my link looks like:
    echo '<a name="News"></a><div id=displaynews><a href="javascript:;" onmousedown="toggleSlide(\'news\');">Display News</a></div><div id="news" style="display:none; overflow:hidden; height:950px;"><br><div id=allnews></div>';

    I'm thinking, escaping the single quotes might've broke IE. But I've not a real clue. It works fine on FF and Opera...

  2. #2
    SitePoint Enthusiast
    Join Date
    Nov 2006
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You don't need to escape single quotes if the function is wrapped with double quotes:
    this is wrong
    Code HTML4Strict:
    "toggleSlide(\'news\');"
    this is right
    Code HTML4Strict:
    "toggleSlide('news');"
    this is right
    Code HTML4Strict:
    'toggleSlide(\'news\');'
    this is right
    Code HTML4Strict:
    "toggleSlide(\"news\");"
    this is wrong
    Code HTML4Strict:
    'toggleSlide(\"news\");'

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2005
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks but of the options.
    "toggleSlide(\'news\');" is the only one which does work. The code is wrapped in echo tags, unescaped single quotes die, and the single quotes are required. Perhaps the problem is not caused by the escaped quotes. I've not a clue... I've set it up just as harry did on his blog.

  4. #4
    SitePoint Enthusiast
    Join Date
    Sep 2005
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks but of the options.
    "toggleSlide(\'news\');" is the only one which does work. The code is wrapped in echo tags, unescaped single quotes die, and the single quotes are required. Perhaps the problem is not caused by the escaped quotes. I've not a clue... I've set it up just as harry did on his blog.

  5. #5
    SitePoint Evangelist
    Join Date
    Jul 2007
    Posts
    345
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does quoting all your id values make a difference?
    e.g. you have: id=displaynews
    what about: id="displaynews" ?

  6. #6
    SitePoint Enthusiast
    Join Date
    Sep 2005
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for your reply, I added it but that didn't fix it.

  7. #7
    SitePoint Evangelist
    Join Date
    Jul 2007
    Posts
    345
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also, one of your div elements doesn't have a matching /div. It's either "news" or "allnews".

  8. #8
    SitePoint Enthusiast
    Join Date
    Sep 2005
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    allnews is an unrelated div.

    The echo function is here:

    Code:
    echo '
    <a name="News"></a>
    <div id="displaynews"><a href="javascript:;" onmousedown="toggleSlide(\'news\');">Display News</a></div>
    <div id="news" style="display:none; overflow:hidden; height:1300px;">
    <br>
    <div id=allnews><a href=http://www.com/index.php?action=News>Read All News</a></div>';
    The displaynews div ends further down after more code in a different echo.


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
  •