www.webdeveloper.com
Results 1 to 4 of 4

Thread: document write problem

  1. #1
    Join Date
    Nov 2009
    Posts
    3

    Question document write problem

    Code:
    document.write('<div class="tool"><A href="javascript:openWnd(\'http://domain.com/url?' + friendlink + '\', \'Email\', 580, 480, 0, 0, 0, 1, 1, 0, 0)" class="tools">Send a Friend</a></div>');
    This ‘document write’ (loaded from an external .js file) works in IE6 but not in the newer browsers. What’s wrong with the escape of the quotation marks?
    Last edited by Kor; 11-18-2009 at 09:29 AM. Reason: wrap the code [code][/code] and remove the smilies

  2. #2
    Join Date
    Nov 2002
    Posts
    4,473
    Quote Originally Posted by swiss-imp View Post
    What’s wrong with the escape of the quotation marks?
    You missed one.
    Code:
    document.write('<div class="tool"><A href="javascript:openWnd(\'http://domain.com/url?\' + friendlink + '\', \'Email\', 580, 480, 0, 0, 0, 1, 1, 0, 0)" class="tools">Send a Friend</a></div>');

  3. #3
    Join Date
    Nov 2009
    Posts
    3
    This was intentionally as it is the 'end sign' of the first text block.

    Document write is working now (I have defined the variable 'friendlink' globally in an other script - this works in older browsers but not in the new one)

    However, still have the problem that the function openWnd(); does not execute when clicked. (works also in old browsers)


    TEXT BLOCK 1: <div class="tool"><A href="javascriptpenWnd(\'http://domain.com/url?

    VARIABLE: friendlink

    TEXT BLOCK 2: \', \'Email\', 580, 480, 0, 0, 0, 1, 1, 0, 0)" class="tools">Send a Friend</a></div>

  4. #4
    Join Date
    Nov 2009
    Posts
    3
    the problem has been resolved!! sorry, my fault.. I have mistakely placed the external script with the function "openWnd" and the setting of the global variable between an existing IF statement (<!--[if lt IE 7]>) in the header.

    Clearly, it has worked only in the old browser... :-)

    Thanks Gil

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles