-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
Also, we are happy to help you, but we won't do your homework for you. Show us what you are doing, what you've tried, what you are struggling on, and we'll try to help. Key point is that you are trying and you are stuck. But if you post something along the lines of "zomg i have this project due tomorrow someone please 'help' and by 'help' I mean give me the code I need so I can turn it in kkthx"..no.
-
is there any reason why you can't simplify it by putting the months in an array instead of doing all that indexOf, substring and math stuff?
-
If you look in your actual js console instead of those alerts you made, you would see the following (will vary depending on browser, this is from Chrome): Which confirms that you are attempting XSS and that domain doesn't allow it.
-
look in your js console, you should see some sort of message screaming at you if it failed because of it.
-
You can't do this with javascipt. You have to use a server-side language like php and either a flatfile or database. Basically the idea is whenever the form is submitted, the php script will retrieve the current value from the flatfile or database, increment the value by one, store the new value in the flatfile or database, and output the new value in the label. In principle it is exactly like a "page view" or "hit counter" script, so google that for tutorials.
- 1 reply
-
- activeform
- increments
-
(and 1 more)
Tagged with:
-
yah good call... I suppose part of being able to use a different namespace for jQuery is that you actually have to declare it somewhere!
-
my guess is you are trying to run that script on a domain other than www.fhm.com, which is a violation of the same origin policy. IOW unless fhm.com is specifically setup to allow cross domain scripting (XSS), that's not allowed, can't do that. If by some chance the page you are running the script on is that domain, or else you know for a fact that domain allows XSS...then please explain what the problem is. Tell us what what you are expecting it to do and what it is not doing. @teynon: $ is the default namespace for the jQuery library, but it allows for you to specify its namespace in order to prevent conflict with other libraries which use that namespace (for instance Prototype).
-
Well yeah you could do that, depending on how you define "load the page". For example if you have a main content area of your page that uses ajax to load the contents of it (a separate request from the initial page request), you can throw up a preloader while its doing that. IOW,the "preloader" things you see are basically achieved from loading new content (with ajax) on a page that has already been loaded. You basically separate the page load into separate stages: first a basic "container" with the preload stuff, where you can show the preload message, and then the "content" stuff that loads separately (with ajax). But if you are asking if there is some way (with javascript) to show a preloader that exists "above" the initial page load, before anything is loaded...well then the answer is basically no. That scope is on the browser level. Making a "preload" message at that level would require changing or extending the browser itself. So when you say that there is a preloader before "going to the next page", one of two things is happening: 1) You aren't really leaving the page. You stay on the same page and some container on the page is being loaded with new content (with ajax), and the preloader message is displayed until that ajax call is complete. This is what most sites do, what you normally see. And this is fine, especially if it takes more than a second or two to load the new contents up. 2) If it really does take you to a whole new page..well that preloader isn't really preloading the next page, it's just showing you a message and redirecting you to another page eventually. That message you are seeing is pointless and just making you unnecessarily wait before the redirect, as far as actually loading the next page. I rarely ever actually see people doing scenario #2 for the hell of it, however, I do see this happen on sites sometimes. Why? Usually a site will do this when they want to do "cleanup and save" type operations before letting you proceed to the next page. For example, a website may be tracking clicks on a page, so they might execute the tracking script (such as Google Analytics). Or perhaps they want to make an ajax call or two to save some stuff on the page into some server-side session vars. So they want to make sure operations like these are complete before redirecting you, but they don't want the visitor to sit there seeing this delay before redirect, so they throw up a "loading" message as a distraction, because it sounds better to tell a user "please wait while the next page loads" instead of "please wait for this current page to finish doing 'unload' stuff".
-
It's okay to dupe stuff like this to javascript as a convenience to save on server calls but unless you enforce it server-side then you have already failed. Also, we aren't here to just give you free stuff, we're here to help you learn. If you don't understand how to do what you asked for, what makes you so sure what you already have works as intended? Post what you've actually tried.
-
well yes, it's the same principle. It's like when you load up a movie on the internet and it's taking a while to download and instead of making you just sit there and wonder what's going on, it shows you a "loading" message and maybe a % complete or buffering bar or something. It's not strictly necessary, but it's a psychological thing to let people know that hey, nothing is broken, stuff is just taking a little bit to load up and be ready.
-
A lot of AJAX driven sites do this. The basic principle is that when you click the button you get the "loading" message. Meanwhile AJAX is being used to request new data and when a response is received, the "loading" message is replaced with the new content. Strictly speaking it is unnecessary, but from a user experience point of view it may help as a cheap way to handle high traffic sites or sites with less than optimal hardware/bandwidth so that the user doesn't sit there wondering wtf is going on when they click on something and nothing immediately happens that they can see.
-
Website Critique and Beta Test Your Stuff Questions
.josh replied to davidannis's topic in PHPFreaks.com Website Feedback
Umm, you can make a thread there and hope you get some bites, but in general most people aren't really interested in doing full fledged and thorough QA work without getting paid for it, especially if it involves specialized knowledge of the context. Usually people will only do simple/easy stuff like scan for potential exploits or offer opinions on usability/design. As the old saying goes, you get what you pay for. -
Firstly, try removing the equality operator. That's how the jQuery documentation shows it. (I also removed the eslif condition because it's the exact opposite of the if, so it is superfluous): $(function(){ $(".accordionButton").on("click", function(){ if($(this).next().is(":hidden")){ $(".accordionContent").slideUp("slow"); $(this).next().slideDown("slow"); }else $(".accordionContent").slideUp("slow"); }); }); If that doesn't work, try giving some of the answers on this link a try: http://stackoverflow.com/questions/178325/testing-if-something-is-hidden-with-jquery Also, what version of jQuery are you using?
-
my guess is he meant "experience"
-
If you save as .csv then each row should look like value1,value2 or "value1","value2" ..but you are showing pipes...are you just using pipes in your post or is that what you really have in your file? in any case...are you sure this is javascript you are talking about? javascript cannot read files...well, I guess if you have an ActiveX object...is that what you have? Or are you uploading the file and then using php or some other server-side language to respond w/ the contents (i.e. ajax)? IOW, how are you opening the file and getting the data to javascript?
-
The legal definition is the only one that matters, because that is the one the govt looks at when deciding whether or not they should get a cut of whatever it is you are doing. No, the the point of marketing is to get you to hand your money over to the business. That whole "Satisfaction" thing is just a marketing trick, please refer to my previous statements about flattery. The job of a marketer is to figure out the best way to make you part with your money. Telling you that you're awesome and you deserve this awesome product works, so they do it. And they make you sign a contract while you're still misty eyed over compliments and then they've snagged you. And that's why customer service is so shitty: they've already got you in a contract, so they don't have to be nice anymore. Then why are you nitpicking? Your topic evolved into someone calling us a failure under the assumption that we are a business. Approximately 95% of it was just outright "your site/staff fails", 5% (subjectively) pointed at alleged problems and 0% of it has actually offered up any solution or advice for improvement. johnsmith drove his point home about us being a business in one his posts by ending it with the proverbial "customer is always right" statements. I responded to that statement, by pointing out that customers aren't always right and no we don't have to pretend that they are. I gave examples of how customers aren't always right. My choice of word is artistic license; whether you find it "appropriate" or not is a matter of personal opinion, but it was nonetheless relevant. If you read my post and all you got out of it was "oh nohs, bad words that make my ears bleed!" then you entirely missed the meaning behind it and the context it was in, and I invite you to go back and read them again. If it helps, pretend I said "doodiebottom" instead.
-
Umm, no. Here is the legal definition of a business: Any activity or enterprise entered into for profit. We are not considered a business because we are not structured to make a profit. The fact that we do not profit from it ("free" as you say) is very relevant, because that is the core difference between a business and other organizations. The same thing with (most) churches. Churches accept donations, but they do not exist to make a profit. You are right that there are lot of similarities between a site like this or a church vs. a business, but the key defining factor is whether or not the organization's "model" is to make a profit. If an entity does not profit from its services or products, it is not considered a business, but an organization or other form of entity. And I'm not talking about a company looking to make money but just failing at it. There is a difference between a non-profit organization vs. someone who is trying to make money and simply failing at it. Also, the point of a business is absolutely not about the customer. The point of a business is to make money and to profit. Why do you think so many businesses try to make products as cheap as possible and mark them up as much as possible? Why do you think businesses go out of their way to confuse customers and bind them to contracts and stuff? Are you really honestly that naive to think that businesses pretend you are special because you really are? No! Flattery is business 101. Tell someone how awesome they are and they let their guard down and trust you and don't notice that you're lubing them up to stick your fat...you get the picture. The point is, businesses don't give 2 shits about you the "customer", they give 2 shits about the money in your pocket, and they will do absolutely everything they can to get it. Treating you like you're special and "right" is just one tactic that effectively works on people.
-
@jonsmith: As others have already pointed out, we aren't a business, we don't ask for your money, and we don't get paid. But even if we did, (Hypothetically speaking) customers pay for a product or service, and unless the description on the menu board specifically says "...with a side of 'please oh please tell me all about how I'm a failure of a human being for not getting your order right, or making you wait behind other people, or <insert any self-entitled excuse here>", I absolutely have no qualms about calling a bad customer out for what (s)he is and showing them the door. "Then you won't have a business" you say? Sure, maybe if I was in the business of taking crap from customers I might agree, but seeing as how most customers aren't douchebags and seeing as how most customers cheer you on as you're kicking the asshat out the door for thinking he's so damn special or that it's okay to be a douchebag,.I'm going to have to respectfully disagree with your assessment. NOTE: No, I'm not calling you a douchebag or anything. You just mentioned outdated things, so I just wanted to point out that the notion that the "customer is always right" is on that list, as well.
-
I agree with the others...until you have a solid understanding of the fundamentals of the language and methods, you're gonna struggle a lot with a framework. They are supposed to be there as a convenience so you don't have to reinvent the wheel, and provide an easy way to be consistent, especially when lots of people are touching a project. They are not meant to be something to be learned instead of the underlying technology itself.
-
I was actually reading up on Symfony2 but then switched to learning Yii. I read the whole manual and installed it and everything. Was gonna start playing around with it and make a hello world type script or w/e. It did seem like a lot to take in, but well structured. As opposed to Yii... ugh. I admit it was a lot easier for me to get Yii up and running out of the box, but the documentation isn't all that great. Compared to Symfony2 anyways. I have a bad feeling about Yii. It seems less intuitive than Symfony2. But a lot of the stuff at our job was originally done in Yii so it's more beneficial for me to learn it than something else :/
-
Philip is currently making me learn Yii.
-
foreach ($array as $i) { foreach ($i as $team => $tv) { $newArray[$team]['brd_points'] += $tv['brd_points']; $newArray[$team]['ttl_points'] += $tv['ttl_points']; } } print_r($newArray); FYI for future reference, it would make it easier on people trying to help if you post a serialize or var_export of the array instead of print_r. It makes it easy for people to rebuild your array.
-
There are a lot of tools out there that do this already, but I guess it depends on what you are wanting to do whether or not they'd be useful. For example I normally use Xenu (free) for basic crawling. My company purchased a license for Wasp which is a bit more robust but cost monies. But if you are looking to write your own tool, I agree with requinix: using regex to scrape pages for links is not advisable, since regex is not designed to parse html. Basically you would need to: start with the "seed" URL (usually like http://www.yoursite.com/) Use cURL (this is harder to implement, but more advisable, since you can take advantage of cURL's multi-threading. Here is a nice class for multi-threaded cURLing) or file_get_contents (easier to implement, but not advisable, since you can't multi-thread) to get the contents of the URL. Use something like DOM or simplehtmldom to pull all links from the page and store them in an array NOTE: neither method will allow you to get client-side dynamically generated links! There really isn't much you can do about that except get all complicated about it..basically you'd have to setup your server to basically request the script through a "browser" program that will execute javascript and get the links that way. [*]Then basically the overall "loop" would be to repeat the first 2 bullet points until there are no more links in the array.
-
this won't really work, there's potential for collision. Since you are multiplying by random and then substringing...throwing time() into the mix is pretty useless...
-
If it must be an integer, then I would go with Jesirose's suggestion to just make it sequential. If you can let it be alphanumeric, an easy way would be to dechex(time()) If this still doesn't work for you, the next reliable method would be to just generate a random integer and look up in your db if it already exists. Wrap it in a while loop until one is generated that doesn't exist. This could conceivably become an issue when you start to have lots of numbers to lookup against, but that's something you're gonna have to live with, given your current restrictions.