-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
http://www.jquery.com click the big download button, upload it to your server, throw a script tag on your page pointing to it. Looks like you also need to download and put a script include for the UI/dialog plugin as well (you can also find it on their site).
-
LOL wow... look in the mirror mate. We see people like you all day long, and it's always the same story. You went and learned some basics about something, or maybe you're an expert at doing your own unrelated job, whatever it is. Then you took on a client/project not knowing even where to begin even from a top level because you were either a) Too greedy for the money b) Didn't have the balls to say no c) Foolishly thought "How hard can this stuff be?" d) One or more of the above Then the reality sets in and now you're sweating bullets, and the only plan of action you've come up with is to go ask for help on a public forum. And if you really thought our opinions are irrelevant, then why are you here? Seriously, you can stomp your foot and get pissy all you want but advising you to hire someone with experience or otherwise pass it off really is the best advice we can give you.
-
anyways...is there a reason you can't just do this? var y = document.getElementById('myitem').offsetTop;
-
noscript tags are used to execute html when javascript is disabled or otherwise not available. You cannot do the same thing with pure html as you can with javascript...otherwise there would be no point in using javascript. What you need to ask yourself is: "If the user has javascript disabled, what static html content do I want my user to see instead?"
-
In your conditions you are using $_POST[...] instead of $totalwords and $amountneeded p.s. - this is not a regex question.
-
Are you talking about defining a css class in general, like <style='text/css'> .someClass { border: 1px; } </style> It would help if you explain what exactly it is you're trying to accomplish specifically.
-
Listing Directory into a javascript array! Help Pls!
.josh replied to iPixel's topic in Javascript Help
You cannot do this with javascript. You have to use server-side script to get a list of files in directory on server and output it to the client (in the form of a js array or whatever). You can do it on page load or use ajax to make a request to server-side script to get a listing and return results. -
HTMLElement.prototype.getY = function(){ return this.offsetTop; } var y = document.getElementById('myitem').getY();
-
okay well it worked just fine for me .... for reference, this is what I am working with: <form action="search.php" method="get"> <div class="search"> <div class="searchArrowHover"> <div class="arrUp"></div> <dl> <dt></dt> <dd name="search_category"><a href="/">All</a></dd> <dd name="search_category"><a href="/">People</a></dd> <dd name="search_category"><a href="/">Companies</a></dd> <dd name="search_category" class="last"><a href="/">Inbox</a></dd> </dl> </div> <input type="text" size="25" name="search" id="searchInputBox" value="Search" /> <input type="image" name="submit" src="/assets/img/search.png" /> </div> </form> <script type='text/javascript'> var drop_selected = document.getElementsByName('search_category'); for (var x in drop_selected) { drop_selected[x].onclick = function(){ for (var c=0; c<drop_selected.length; c++) { drop_selected[c].setAttribute("class", ""); } this.setAttribute("class", "drop_selected"); return false; } } </script> When I click on a link, page is not refreshed, and I see class for previous one being removed from previous and class being added on the one that was clicked.
-
removing the first one *should* do it. But anyways, seeing as how you aren't wanting the page to refresh, why are you wrapping them in anchor tags to begin with? My first suggestion for you would be to remove the anchor tags. If you're looking to make them look like links in general, then style the dd tags to make it look like it (add underline, :hover attrib, etc...)
-
There is probably a more elegant way to do this (maybe along the lines of keeping track of the last clicked object and removing the class, instead of looping through all of them like I did), but this works: var drop_selected = document.getElementsByName('search_category'); for (var x in drop_selected) { drop_selected[x].onclick = function(){ for (var c=0; c<drop_selected.length; c++) { drop_selected[c].setAttribute("class", ""); } this.setAttribute("class", "drop_selected"); } } And yes, you would just hardcode the first one with class="drop_selected" for the default
-
If I show you how to do that, are you just gonna come back again and say "Oh but what, there's yet another thing I didn't bother to mention before?"
-
okay well "click on" is not the same as "on change". I kinda had my doubts about it, seeing as how that's not a select tag, but I assumed you knew what you were doing with that .onchange. You will want to change .onchange to .onclick
-
first off, in your getElementsByName(..) you typoed your name...but anyways, getElementsByName() returns an array of all elements that match the specified name. So you need to loop through it, something like this: var drop_selected = document.getElementsByName('search_category'); for (var x in drop_selected) { drop_selected[x].onchange = function(){ this.setAttribute("class", "drop_selected"); } }
-
Also, since we probably won't be jumping in individually welcoming every single person comes by, here's your generic welcome message: Greetings, ___________ ! Thank you for joining the board! Feel free to ask any question, but please don't be stupid about it. Make an effort to pick the right forum, make an effort to be detailed about your question, make an effort to read relevant stickies/rules, and we'll make an effort to help you. .CV
-
http://www.phpfreaks.com/tutorial/php-basic-database-handling
-
"level system" is pretty ambiguous... care to be more specific?
-
http://www.phpfreaks.com/tutorial/php-add-text-to-image
-
GENERAL RULES AND GUIDELINES FOR POSTING This forum is not meant to be a formal freelance service system. It is available for those who wish to seek out services or work from other people, as a courtesy to the members of the phpfreaks community. phpfreaks.com does not specialize in freelance services. This forum is an informal mechanism, as a courtesy to the community. We have no formal mechanism in place (like escrow) to guarantee payment, refund, work done, etc... phpfreaks.com shall not be held responsible for any losses you incur. we have never and continue to not act as any kind of mediator or verification/compensation source for people/organizations who use those forums. We will not be held responsible/liable for any damages, loss, etc. that occur from use of those forums. If you hire someone and they rip you off, don't come crying to us. If someone hires you and they rip you off, don't come crying to us. Those forums are a convenience. If you want something more official that offers guarantees, go to a real freelance site! If you have any questions regarding the freelance forum, feel free to ask them here. RULES: WHERE TO POST:If you want to offer your services, post in the Service Offerings sub-forum.If you want to offer a job or position of employment, post in the Job Offerings sub-forum. DO NOT post your 'resume' in job posting threads. You must directly contact the person you wish to reply to. The only reason replies are allowed is to ask for clarification/details about the job. Failure to adhere to this rule will result in all kinds of things, like you getting banned, or us disallowing replies. DO NOT make more than one thread offering your services. You can edit/reply to your thread to reflect additions/changes. DO NOT post advertisements to other sites offering freelance system services. For example, rentacoder.com, odesk.com, etc.. we have no partiality for or against those sites, but posts such as those are regarded as advertisement, which is against our main site rules. We fully acknowledge that this freelance system is limited, but we aren't here to provide free advertising for other places. If you prefer to do actual business through one of those sites, please specify in direct contacts with the person. You are allowed, as a freelancer or freelance company, to post a link to your personal portfolio/company to those sites, or a site that you own. But general promotions to those other sites are not allowed. GUIDELINES: When posting in the freelancing forum it's important that you provide a way for users to contact you. They will not be able to reply to your topics so they need a way to contact you privately. This can be using PMs, emails, any type of instant messaging service (MSN, Gtalk, AIM, Jabber, etc.) or however you see fit.The more specific you are about your skills, previous experience(s), availability, rates, etc.. the better your chances of getting serious inquiries. Posting vague "I'm available for anything and everything" might get more inquiries on average, but there's a good chance that it will come to nothing, based on any number of things that you could have posted here in the first place. Better to receive 10 emails from people who have some idea of your qualifications/terms, than 100 emails that don't.Be honest about your skills. All day long we see people posting about how they jumped on a job and bit off more than they could chew. They tell the client they can do everything they need and more, promise them the moon, and then promptly crap their pants about 5 minutes into it. Don't be that person! Some people get lucky and figure it out. Some people get lucky and get help that figures it out. Most people end up having to give up the project. Which leads us to....Wasting people's time and money. You waste the client's time. You waste your own time. That bad rep will more than likely come back to haunt you. All day long we get people trying to get us to delete their posts because they don't want their skeletons to come out of the closet (no we won't hide them for you). So be smart! Do the simplest easiest thing to avoid all this headache: be truthful about your skills. If you feel that being truthful will limit your potential clients, then get off your bum and hit the books. You can't seriously be in the business of trying to con people, are you?Be very clear about what you are doing. Some clients know your job, and are just looking for extra set of hands. Most do not, and therefore seek someone who does. Therefore, if you want to avoid headaches, it is your responsibility to be very clear about what it is you're going to do. What you're willing to do. What kind of support you offer after the fact, etc... on that note..Be up front and thorough about your prices. Take a look at the situation. Quote a price for it. Quote prices for things that might come up later. The more you have to go back later saying that xyz was unforseen or xyz wasn't part of the deal, regardless of whether or not you are in the right, the more you are going to come off as shady, to the client. It's like when you take your car to a mechanic and that funny noise goes from being one little $50 thing to a $2000 rebuild because the mechanic kept coming back to you saying something else is wrong. That stuff may indeed be needed, but the fact that you didn't think about it and let them know ahead of time speaks volumes about your skills as a coder. Some things just aren't foreseeable. Most things are.
-
I believe thorpe is working on something like that right now. Don't have an ETA or anything.
-
How about a captcha tutorial? Lots of them around, but we're supposed to be a resource, right? I may do it myself, if someone else doesn't volunteer.
-
Honestly I don't really see anybody writing a tutorial like that on a technical level (actual code). Maybe on some kind of abstract level, like conveying general principles and program flow and good design, advice and pitfalls, etc.. but most tutorials that involve actual code are for teaching how to make building blocks. Things like forums and blogs and cms' are more like actual buildings, not building blocks. If you sit down and break down for instance all the things in a forum, you will quite easily find tutorials for just about all of those 'building blocks.' I suggest you either do that, or maybe find an open source version of one of those things and jump into it, instead.
-
The Super Cool Mostly Official Frankenstein-Code Game Thread!
.josh replied to .josh's topic in Miscellaneous
okay I thought I'd make a new post instead of editing the last one, since it's on a new page. Okay, It's all about.. Bride of Franky! <?php $relatives = array('mother', 'father', 'sister', 'brother','uncle', 'auntie'); $verbs = array('dislikes', 'sits on', 'licks', 'sucks', 'looks like', 'does', 'discusses the pros and cons of Web 2.0', 'loves', 'caresses', 'slides onto', 'hates', 'kisses', 'learns PHP with', 'has an AJAX interface with'); $animals = array('dogs', 'cats', 'horses', 'birds', 'giraffes', 'elephants', 'hippos', 'hamsters', 'gerbils', 'monkeys'); $adjectives = array('abhorrent','abject','abnormal','abrasive','absorbed','absurd', 'abusive','acrid','agonizing','ambiguous','ancient','apathetic', 'average','bad','barbarous','bawdy','belligerent','berserk', 'bizarre','black','boorish','brash','brawny','burly', 'callous','cold','colossal','combative','crabby','craven', 'crazy','creepy','crooked','cynical','demonic','deranged', 'devilish','direful','dirty','disagreeable','draconian','drunk', 'dysfunctional','erratic','evasive','evil','filthy','flippant', 'gaudy','giant','gigantic','greedy','grotesque','grouchy', 'gruesome','grumpy','guiltless','hellish','horrible','huge', 'hulking','icky','immense','irate','jaded','jittery', 'macho','maddening','malicious','mammoth','maniacal','massive', 'mighty','mindless','moaning','moldy','murky','mysterious', 'nasty','nauseating','noxious','oafish','obscene','psychotic', 'rabid','ruthless','sassy','scary','smelly','snobbish', 'snotty','spooky','threatening','tightfisted','tough','towering', 'trashy','ugly','unbecoming','unsightly','vagabond','vengeful', 'venomous','vulgar','wicked','wrathful','wretched'); function insult($secondary_person) { global $relatives; global $verbs; global $animals; $r_size = sizeof($relatives) - 1; $v_size = sizeof($verbs) - 1; $a_size = sizeof($animals) - 1; $r_rand = rand(0, $r_size); $v_rand1 = rand(0, $v_size); $v_rand2 = rand(0, $v_size); $a_rand = rand(0, $a_size); $insult = "Your {$relatives[$r_rand]} {$verbs[$v_rand1]} $secondary_person and {$verbs[$v_rand1]} {$animals[$a_rand]}"; return $insult; } class Greeting { function Greeting() { echo "Hello World!"; } } interface Singleton { public static function getInstance(); } interface Actor { public function speak(); public function meet($person); public function eat($animalArr); } abstract class Intestant_Abstract { abstract public function input($input); abstract public function output(); } class Stomach extends Intestant_Abstract implements Singleton { private static $instance; public static function getInstance() { if (!isset(self::$instance)) { self::$instance = new self; } return self::$instance; } private function __construct(){ } public $kilosOfFood; public function input($input){ $this->kilosOfFood += strlen($input); echo 'Franky liky to eats '.$input.'..<br />'; if($this->kilosOfFood > (strlen(implode('',$GLOBALS['animals']))/1.5)){ $this->output(); } } public function output(){ echo '<br />Bhaarf..<br />'; } } class Guts implements ArrayAccess, Singleton { private static $instance; public static function getInstance() { if (!isset(self::$instance)) { self::$instance = new self; } return self::$instance; } private function __construct(){ } private $intestants; public function add($name){ $this->intestants[$name] = call_user_func(array($name, 'getInstance')); } public function remove($key) { unset($this->intestants[$key]); } public function offsetExists($offset) { return isset($this->intestants[$offset]); } public function offsetGet($offset) { return $this->intestants[$offset]; } public function offsetSet($name, $value) { $this->add($name); } public function offsetUnset($offset) { unset($this->intestants[$offset]); } } class Franky implements Actor { private $person; public function meet($person){ $this->person = $person; } function eat($animals){ shuffle($animals); $guts = Guts::getInstance(); $guts->add('Stomach'); $guts['Stomach']->input(next($animals)); } public function speak($insult_them = false){ if($this->person == null){ $greet = new Greeting(); echo '<br />'; } else { echo 'Hello '.$this->person.'!<br />'; if ($insult_them) { echo insult($this->person) . '<br />'; } } } } if (isset($_POST['relativeName'])) { $relativeName = $_POST['relativeName']; $relativeType = $_POST['relativeType']; $h = new Franky; $h->speak(); $h->meet($relativeName); $h->speak(true); $h->eat($animals); $h->eat($animals); $h->eat($animals); $h->eat($animals); $h->eat($animals); $h->eat($animals); $h->eat($animals); $h->eat($animals); $monstername = $adjectives[array_rand($adjectives)]; echo "<br/>Franky wants to marry your $relativeType.<br/>"; echo "$relativeName will join the monster family and<br/>"; echo "$relativeName's monster name will be $relativeName the $monstername.<br/>"; } else { $person = $relatives[array_rand($relatives)]; echo <<<FORMINT What's your $person's name?<br/> <form action = '{$_SERVER['PHP_SELF']}' method = 'post'> <input type = 'text' name = 'relativeName' size = '10'> <input type = 'hidden' name = 'relativeType' value = '$person'> <input type = 'submit' value = 'submit'> </form> FORMINT; } ?> -
The Super Cool Mostly Official Frankenstein-Code Game Thread!
.josh replied to .josh's topic in Miscellaneous
<placeholder>