Jump to content

dgabrahams

Members
  • Content Count

    25
  • Joined

  • Last visited

Community Reputation

0 Neutral

About dgabrahams

  • Rank
    Newbie
  1. Thanks, I know what an event handler is, but mostly I use things like 'onclick' with some JavaScript functions - I presume this will not need to be edited? What type of handlers were you referring to? I like to stay close to the bone if I can, but I do need more JQuery experience...
  2. Thanks that was a good link. It was kind of what I was doing, I have been suffering recently! I was using documentFragments before and performance was always ok... To confirm a document fragment is static isn't it and not dynamically linked to the DOM in any way? CloneNode too is not linked to the DOM? Also, is there a way to restore event handlers?
  3. This is contrary to what I have been told. Apparently it is expensive to cross over into the DOM, so say I have 20 document.getElementByid lines in a row, it makes sense to put these into a fragment then update once. The issue was mostly around reflows, as each change would spark a reflow, so using fragments prevents this. The fragment is static apparently and not live updated, so you can make changes then push to the DOM without causing any reflows. I was using the cloneNode method when populating a fragment (getElementByid.cloneNode) to help guarantee this... I was simply thinking of
  4. Hi all, I'm looking into performance, one thing was to stop accessing the DOM all the time and using document fragments to construct what I want to change and then making a single push to update the DOM. I want to take this a step further and keep a constant model in memory, make changes then push every so often. I was thinking of pushing at a rate of around 60hz, and keeping the model alive in memory by making an update to the DOM every so often (60hz) using the settimeout method. The documentFaragment will be initially populated using a getElementById on either the main div or a sele
  5. Foxy Mod - Thanks for the rounding idea, that should help solve this as far as implementation is concerned. More Human Than Human - thanks for the link! Believe it or not I found this issue in MS Excel years ago, no matter how accurate I made some numbers they never resulted in a rounded figure - was tearing my hair out - this is of course before I knew about how the numbers were actually made and the short comings of possible standards...
  6. Thanks - didn't know about BigDecimal, I don't want perfect accuracy, I just want 0.1 + 0.2 to equal 0.3!!!
  7. Thanks, I had a feeling it was something like this, I have done some work with binary. I feel it is quite a flaw in the language, if the maths doesn't work, that could cause trouble (or maybe it works too well creating such accurate approximations, difficult to work with though??).
  8. Hi All, In this video: http://www.youtube.com/watch?v=lTWGoL1N-Kc Douglas Crockford states that 0.1 + 0.2 !== 0.3. I performed this test: <script>var test = 0.1 + 0.2;document.write("test = " + test);</script> And the answer on the screen was: 0.30000000000000004. This of course proves his point. However: <script>var test = 0.1 + 0.3;document.write("test = " + test);</script> Gives a result of: 0.4 - which is correct. Why is this so? I know that it is something to do with the implementation of the floating point standard, but can anyone provide any further
  9. There are reserved words and then there are other words that Javascript understands, such as length, up, down etcI need to know where to find these, I have already found the reserved words - I simply call them such as they are similar to reserved words but not exactly.......
  10. thanks some very useful info!I have looked again at the W3C pages, where do they list the .up and .down stuff?
  11. I am still getting to grips with Javascript and need some help.........I have gathered that if I use a 'var' I can call it whatever I want. There are however reserved words which seems to be a very small list that I have found in the back of a book I am learning from........My problem is things such as 'getElementById' I would consider in my layman terms a reserved word, and many scripts I try and read have these kind of things and many I have never heard of...............another example script being the use of 'element.up' or 'element.down' - my problem is I still have no way of telling what
  12. thanks guys!!!!I simply removed & replaced the double quotes with singes and put it all on one line.................deamweaver likes it and so does the website
  13. thanks - I am currently stuck with not being able to put a table into my js file - a real noob issue I am afraid!document.write("<table border="0" class="menu_content"> <tr> <td><a style="color:#1e2f4d" href="">Home</a></td> <td class="menu_divider"></td> <td><a style="color:#1e2f4d" href="">About us</a></td> <td class="menu_divider"></td> <td><a style="color:#1e2f4d" href="">Contact us</a></td> </tr> </tabl
  14. an update in case anyone is interested (since we all have such fulfilled lives to be working with js!).It seems the syntax error is non anchor tag related so thats all good!
  15. I am using dreamwaever and trying to put an anchor tag inside a document.write command but it is telling me there is a syntax error.is it possible to put anchor tags inside the content of document.write command?
×
×
  • Create New...