Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code>this.setAttribute("style","text-decoration:underline </code></pre> <p>Don't use setAttribute, it won't work in IE&lt;8 for many cases (including this one) and the HTML/CSS-DOM properties are more readable: <code>this.style.textDecoration= 'underline';</code>.</p> <p>(These days you may want to use a CSS <code>:hover</code> rule instead of JS hover-highlighting. It's only IE6 where arbitary-hover doesn't work; the last remaining IE6 users can often do without the shiniest stuff as long it it still works. They're probably used to seeing broken web sites by now...)</p> <pre><code> if(browser.isIE) { summaryDiv.onclick = new Function("__fc.show_tooltip("+j+",'view_month')"); } else { summaryDiv.setAttribute("onclick", "__fc.show_tooltip("+j+",'view_month',event)"); } </code></pre> <p>No need for nasty old browser sniffing (avoid!) as the first of those will work in all browsers. However, creating a function from a string is really ugly. You can use a function literal instead:</p> <pre><code>summaryDiv.onclick= function() { __fc.show_tooltip(j, 'view_month'); }; </code></pre> <p>However if you're doing this in a loop (over <code>j</code>?) you may be subject to the <a href="https://stackoverflow.com/questions/2568966/how-do-i-pass-the-value-not-the-reference-of-a-js-variable-to-a-function">Closure Loop Problem</a>. You can get around that with another closure, but ECMAScript Fifth Edition's <code>Function#bind</code> is cleaner:</p> <pre><code>summaryDiv.onclick= __fc.show_tooltip.bind(__fc, j, 'view_month'); </code></pre> <p><a href="https://stackoverflow.com/questions/2568966/how-do-i-pass-the-value-not-the-reference-of-a-js-variable-to-a-function/2569493#2569493">Adding bind to browsers that don't yet support it.</a></p> <blockquote> <p>but onclick event [on clone] is not getting fire in case of Internet Explorer.</p> </blockquote> <p>Yeah, it's normal for event handlers not to get copied when cloning. (Actually, it's usually IE mistakenly cloning listeners added via attachEvent that's the problem, so that's the other way around.)</p> <p>If you want to retain the event handling after cloning you'll have to do it manually:</p> <pre><code>newClone.onclick= oldNode.onclick; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload