Jump to content

Iluvatar+

Members
  • Posts

    100
  • Joined

  • Last visited

Everything posted by Iluvatar+

  1. Why would we prototype the walk() method though?
  2. Hi guys i am trying to help out a friend with a bit of work and there is a question i am unsure of... "Define an object Animal that has a member function walk(). Then define an object Elephant that is a sub-class of Animal. Define a member function trumpet() on the Elephant object. Create an instance of the Elephant object and call both functions on that instance." Here is what my thoughts were... function Animal() { this.walk = function() { return 'walk walk walk'; } } function Elephant() { this.prototype = new Animal(); this.trumpet = function(){ return 'splash splash'; }; return this; } var Elephant1 = new Elephant(); console.log(Elephant1.prototype.walk()); console.log(Elephant1.trumpet()); I am unsure if i am going to right way about this.
  3. Thanks for you help guys, sorry i didnt reply sooner.
  4. What is it your trying to do here...i dont have a clue what your on about
  5. I have a drupal module that generates a csv and spits it out onto a blank unmarked-up page. What i need is a bash-script to run on a cron-job to get the csv content and save it as a file (with unix timestamp as its name) onto another server. This is something i have never done before so if anyone would be kind enought to lend a helping hand it would be much apreachated.
  6. I need to generate a csv orders file from an array and store it in a directory on the server. Has anyone done this before?
  7. Cheers dude, ill be making the modifications asp
  8. function open_win(val) { window.open ("chats.php?id="+val,"mywindow","menubar=1,resizable=1,width=350,height=500"); }
  9. You coulds pass the value of the select into the js function and append it on the URL and dectect the value on the pop-up using $_GET
  10. Well i apologise for my lack of response. From my observation it seems there was confusion between $_GET and $_POST.
  11. echo '<pre>'; print_r($_POST); echo ''</pre>; :| check
  12. I see, i was just wondering because there has been a case or two were i have resulted in using query in a loop. Do you think you should generate a single query in a loop to execute it once complete? Come to think of it i used recently to update multiple fields on the bases of an array of passed id's. /* Ticket Updates */ public function ChangeCaseStatus($status,$ticketIds) { empty($this->errors); // clear errors for($i=0;$i<count($ticketIds);$i++) { if(!mysql_query('UPDATE '.$this->defaultTable.' SET status="'.$status.'" WHERE id='.$ticketIds[$i])) { $this->errors[$i] = $ticketIds[$i].' [status : '.$status.'] '.mysql_error(); } } return $this->notification(count($ticketIds),'Marked '.$status); }
  13. Keep geting this error 'Warning: file() [function.file]: URL file-access is disabled in the server configuration in /home/landau/public_html/includes/PostalalCodeAnywhere.php on line 41' The obvious solution is to enable it on the server, however i have read on several forums thats it's unsafe to do this.
  14. Well i am not sure if this is a php issue or not. I think you need to explain a little more on what you trying to do. You want to dynamically set to buttons at the end of a video to go back for forward?
  15. Create an empty table with all the feilds you expect to get from you XML feed, then write some functions that can pull the XML in and strip it, loop it and store it! // something like that function PrepareData($URL){ /* Open the URL into a file */ $ContentsFetch=file($URL); foreach ($ContentsFetch as $line_num => $line) { if (strpos($line,"<Item ")!=false) { $Contents[]= $line;} } for ($i=0;$i<count($Contents);$i++) { /* Strip out "<Item " and " />" from the XML */ $Contents[$i]=substr($Contents[$i], 6+strpos($Contents[$i],"<Item ")); $Contents[$i]=substr($Contents[$i], 0, strlen($Contents[$i])-4); $breakapart=explode("\"",$Contents[$i]); /* Extract field names and values */ for ($x=0;$x<count($breakapart);$x++){ if ($x % 2 == 0){ $k=trim(str_replace("=", "", $breakapart[$x])); if ($k!='') { $this->Data[$i][$k]=$breakapart[$x+1]; } } } } return $this->Data; }
  16. You would have to use some AJax to do this.
  17. http://www.firsttube.com/read/sorting-a-multi-dimensional-array-with-php/
  18. I have sorted the problem now just applied it in the ajax function. Thanks for you reply.
  19. I have called some ajax to bring in some html. In their html there is a form with select box's which i have a replacement plugin. However, i have included my plugin and applied it in the main html document and wrapped in in the document ready function but it just won’t apply to new dom elements with the ajax call. Andy ideas?
×
×
  • 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.