Search Results

Search found 2 results on 1 pages for 'icepack'.

Page 1/1 | 1 

  • where is the best place to place a javascript snippet to alter the DOM of a page before it renders

    - by icepack
    I have a few dynamic pages and I want to alter certain elements before the page has fully rendered. My snippet is something like document.body.getElementById("change").innerHTML = "<img src..."; I do not have access to change the content server side. Where is the best place to put the snippet to have the code run before the page it has rendered? Rather, is putting the javascript in either the HEAD (inside the window.onload event?) or before the closing BODY(not inside an event listener) optimal?

    Read the article

  • Why doesn't C have rotate left/right operators?

    - by icepack
    A bit of a philosophical question, I suppose. Hope it belongs here. C language has the standard set of bit-wise operations, including OR, AND, XOR, SHIFT LEFT/RIGHT, NOT. Anyone has an idea why rotate left/rotate right isn't included in the language? These operators are of the same complexity as other bit-wise operators and normally require a single assembly instruction, like the others. Besides, I can think of a lot of uses for rotate operator, probably not less than, say, xor operator - so it sounds a bit strange to me that they aren't included in C along with the rest. Edit: Please stop suggesting implementations of rotation operators. I know how to do that and it's not what the question about.

    Read the article

1