Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

7 Neutral

About beennn

  • Rank
  1. The results in the example above are stored in the array in the order that the response is received, not in the order that the requests are sent. So in the original post, where xhr[0] should equal 0.png, it's possible that 1.png is received before 0.png and so that is stored in xhr[0] instead.
  2. Thanks, wasn't the answer I was hoping for, but it got me on the right track. I ended up adding the responses to an array; when I had all the responses back, I sorted the array from 0 upwards and that fixed me problem. Alternatively, if I didn't need to set responseType, I could have just set async to false.
  3. I am trying to fetch some images from a server, however I need them to come back in the order requested. Currently, the below returns the images back in a seemingly random order, I guess which ever are finished first. How can I ensure I get the images back in the order they were requested? var xhr = [];for (i = 0; i < count; i++){ (function (i){ xhr[i] = new XMLHttpRequest(); xhr[i].open( "GET", url + dir + "/" + i.toString() + ".png", true ); xhr[i].responseType = "arraybuffer"; xhr[i].onreadystatechange = function () { if (xhr[i].readyState == 4 && xhr[i].status == 2
  4. I'm trying to convert: http://techslides.com/demos/image-video/create.html to work with images on a server. Currently the demo above uses local files: if(filesarr.length>0){ //loop through them and process for(i=0; i<filesarr.length; i++) { var file = filesarr[i]; if(file.type.match(/image.*/)){ process(file); } else { document.getElementById('status').innerHTML = "This file does not seem to be a image.";
  5. Is it possible to print an image (send it to a users printer) that is not on the current page? I have an application which uploads an image to a server, then a js function which currently opens the image alone in a new window, where I am then printing the image from. However instead of this, I would prefer the user stay on their current page, and have the print dialogue pop up there, rather than sending them to a new window with just an image. Any help or advice is much appreciated.
  6. Ah ok, I'll do that. Thank you both for the help.
  7. Is it not possible to achieve the desired result with a single div that's floating left?
  8. Currently I have: However, I'm after: Using: .expandable_window { float:left; margin-top: 20px; margin-bottom: 20px; margin-left:20px; max-width:46%; background: linear-gradient(white, c8c8c8); box-shadow: 10px 10px 5px #888888; } Any help is much appreciated.
  9. Thanks for this, looks like it could be - definitely a big help. I believe that method specifically only applies to MySQL databases though; not saying you can't achieve the same thing with other dbms's. I've managed to find what I was looking for, and they do compare to those seen on the wiki, just named differently. I'll post it here since I was unable to find it anywhere else. Full (Dense) Index Partial (Sparse) Index Partial Block Index Multi-level Index Partial Block: A partial index can be used to index blocks of data efficiently. The partial index contains the key value for
  10. Types of Indexes: Full - examines all of the words in every stored document as it tries to match search criteria (text specified by a user). Partial - also known as filtered index is an index which has some condition applied to it so that it includes a subset of rows in the table. Partial-Blocked - ? Multi - ? Does anyone know any learning resources where I can read up on partial-blocked and multi indexes? I'm unable to find anything under these terms, perhaps they are known as something else? Also, how do these compare to types of index found here: http://en.wikipedia.org/wiki/Databa
  11. I have several of the same floating div, and I'd like them to have an equal margin between themselves and other elements on the page, for example the header and footer (if there's a margin of 5px on the floating div, this stacks to 10px when touching the same div, however when hitting the header or footer, is only 5px). Is it in anyway possible to collapse a margin connected to a floating div? Currently I've just added and extra margin to the top and bottom of the footer/header to make the difference, but in the long run, if it's possible; it would be easier if there was a way to collapse them
  12. My understanding is, collapsing margins on a floating div is not possible, is there a work around which can achieve the same effect?
  13. beennn

    Floating Divs

    Aah, thank you. The div which the content div was in had a margin which was causing it.
  14. beennn

    Floating Divs

    I'm having some trouble getting multiple divs floating next to each other. Here's what I have so far: .content { width:auto;max-width:100%;float:left;padding:15px;} which gives: However I'm aiming for: Any ideas?
  15. Here's what I've tried: <script> <? for ($i = 0; $i < sizeof($result_array); $i++) { ?> document.write('<? echo $i ?>'); <? } ?> </script> and <script> <? for ($i = 0; $i < sizeof($result_array); $i++) { ?> document.write('<? $i ?>'); <? } ?> </script> I've also tried just using JavaScript with the PHP variable embedded but still not luck. Any ideas? EDIT: Turns out I just needed to use <?php instead of <?
  • Create New...