Jump to content

everisk

Members
  • Posts

    95
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

everisk's Achievements

Member

Member (2/5)

0

Reputation

  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!
×
×
  • 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.