Jump to content

everisk

Members
  • Posts

    95
  • Joined

  • Last visited

    Never

Everything posted by everisk

  1. Actually it works fine, I just mistake the $line for $i $fd = fopen ("file.csv", "r"); // read csv line by line $line = 1; $content = array(); while (!feof ($fd)) { $buffer = fgets($fd, 4096); $content[$line] = explode(',', $buffer); $line++; // i mistyped this } print_r($content);
  2. Haven't test it and dont know what str_getcsv output but i think you can get it into array by reading it line by line $fd = fopen ("file.csv", "r"); // read csv line by line $line = 1; $content = array(); while (!feof ($fd)) { $buffer = fgets($fd, 4096); $content[$line] = explode(',', $buffer); $i++; } Content of CSV file should be in $content
  3. Hi, I have a draggable and droppable element that when item is dropped on to the area it added some elements. However, I want to be able to remove the dropped element. Below is the sample of my code $('#comparecampaign').droppable({ drop: function(e, ui) { if($firstdrop==0) { $(this).empty(); $firstdrop = 1; } $id = $(ui.draggable).attr('id'); $text = $(ui.draggable).attr('text'); $add = '<div id="comparecontainer'+$id+'"><input type="hidden" name="compare[]" value="'+$id+'" id="compare'+$id+'" />'+$text+'<a href="#" class="tooltip" title="Delete campaign from list" class="removecompare" onClick="removeCompareCampaign(\''+$id+'\');" id="'+$id+'">Del</a></div><br />'; $(this).append($add); function removeCompareCampaign($id) { $('#comparecontainer'+$id).remove(); } } }); With the above code, I get removeCompareCampaign in not defined in Firebug. How do I get this working? Thank you.
  4. Hi, I have the below code that should run on ready(). It works fine on Firefox but not IE Any ideas? THank! <script type="text/javascript"> $(document).ready( function() { var $items = ['regular', 'outsource', 'total_headcount', 'internal', 'external', 'resigned', 'eligible', 'member', 'valoptec_percent']; $($items).each(function() { totalIt(this); }); } );
  5. I still get the same error. But thanks! I got it working by $(document).ready( function() { totalIt(); } );
  6. Thanks for the quick reply Rajiv I got this error on Firebug missing ) after argument list [break on this error] $('.regular').blur(totalIt);\n
  7. Hi I'm a jquery newbie. I'm trying to sum a column with below code on page load. it works fine. But I also want to update the total when the input changes. How do I do that? I dont even know how to specify a function in jquery Basically, something like <input type="text" name="whatever" id="whatever" class="regular" onBlur="runJqueryFunction()" /> $(document).ready( function() { var total=0; $('.regular').each( function() { total = parseInt(total) + parseInt(this.value); } ); $('#total_regular').text(total); } );
  8. hmm .. seem like no one gets what i want thanks anyway
  9. idToLoad is part of container_upper_bg, but container_upper_bg contains a few others div, including idToLoad. However, idToLoad might contain its own children (div) and I only want idToLoad and its children to fadeIn .. not all children of container_upper_bg. HTML is something like <div id="container_upper_bg"> <div id="home"> <div id="container_upper_center"> <div id="upper_left"> Some information </div> <div id="upper_right"><img src="images/home_pic.jpg"></div> </div> <!-- end container_upper_center --> </div> <div id="service" style="display:none"> Some other information </div> </div> <!-- end container_upper_bg -->
  10. I have a code like //we search trough the content for the visible div and we fade it out $("#container_upper_bg").find("div:visible").fadeOut("fast", function(){ //once the fade out is completed, we start to fade in the right div $("#container_upper_bg").find("#"+idToLoad[0]).fadeIn(); <--- Here I want find #idToLoad and its children, then fadeIn .. How do I do that? Thank you in advance!
  11. oh? how do I do that then? Sorry I'm clueless ...
  12. Hi, I'd like to be able to use URL1.com but all traffic/all pages should redirect to URL2.com. I dont think it's a redirect because I still want URL1.com to be shown on address bar. How to do this with Rewrite rule? Thank you!
  13. Hi, I'd like to match any characters until running into a space. currently i have (.)+ but I dont know how to mark the end. Thanks!
  14. I dont have a general css defined for lists such as ul { ... } or li { ... } but I do have some other css defined for other div id. I'l try to go through and check for inheritance. If anyone has other ideas .. please feel free Thanks!
  15. Oh forgot to mention that the space looks wide only in Firefox. In IE it looks much closer. Thanks!
  16. Hi, When use list element there is always a wide space after the bullet point, something like * [blah blah]. How to control the space after the bullet? I have tried padding: 0; margin: 0; but to no success. Below is a part of my CSS and HTML. HTML ===== <div id="divid"> <ul><li>blah 1</li> <li>blah2</li> </ul> </div> CSS ===== #divid ul { padding: 5px 0px 0px 0px; margin: 0px 0px 0px 10px; } #divid ul li { list-style-image: url(../images/bullet_blue.gif); margin: 0; padding: 0; } [attachment deleted by admin]
  17. hahah .. oh .. i didn't get it and i thought what i gave was enough. Sorry!
  18. I don't quite understand what you mean below is structure of my page. Could you show me what I have to remove? <div id="supercontainer"> <div id="top_bg" style=" margin-left:auto; margin-right:auto; width:1000px; height: 260px; background-image:url(../images/bg_top.jpg); background-position:center; background-repeat: no-repeat; z-index:98;"> </div> <div id="content_container" style="margin-left:auto; margin-right:auto;width: 900px; position: relative; top: -260px; z-index:99;"> This is a container of all the rest of the content <div>a bunch of div inside</div> <div>a bunch of div inside</div> <div>a bunch of div inside</div> </div> <div id="footer" style="clear: both;">Footer</div> <!-- ***there is 260px empty space here*** --> </div> <!-- end of super container -->
  19. Hi, I have a layer that must overlay on another layer so I have to put "position: relative; top: -260px;" in. There are several other divs below that to make the page. However, there is a 260px empty space at the bottom of my page and I dont know how to get rid of it. I know the reason is because the top: -260px. BTW, all DIV are inside a supercontainer div (if that helps). How do I fix this empty space? Thanks a lot!
  20. wowww .. thanks a lot, Daniel0! It works perfectly
  21. The string can be anything based on what user input. As of now I'm testing with Thai characters but I think there is a function that decode Unicode character to their correct language (just like http://www.crypo.com/eng_urld.php <-- this is actually what I expect). The page uses UTF-8 as encoding. The result is the character corresponding to the Unicode. For Thai language the code table is http://www.unicode.org/charts/PDF/U0E00.pdf. My test string is %u0E19%u0E32 which should output นา
  22. I'm trying decode Unicode string pass via URL just like this website. I have trying and testing different functions found on Google but to no success Only this website produce accurate results. Any ideas? http://www.crypo.com/eng_urld.php
  23. Both adding header and urldecode() dont work for me The actual page is in UTF-8 and actually the value is passed via editinplace function which i think use javascript prototype to pass the value via AJAX.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.