Jump to content

Adam

Moderators
  • Posts

    5,717
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Adam

  1. Are you aware of the array_rand() function by the way? Sounds like it may be of use to you here.
  2. First of all you're trying to overwrite the super-global $_GET array with the HTTP referrer. Just use strpos() to check if the match is found within the HTTP referrer: <?php if (strpos($_SERVER['HTTP_REFERER'], '.r.msn.com') !== false) { header('Location: http://www.mysite.com'); } else { header('Location: http://www.google.com'); } ?>
  3. You mean customername.domainname.com? Are you wanting to have 'fake' sub-domains sort of thing?
  4. In 'attempt 1', I don't see any variables being used except for $lastname? Where do you have the form inputs?
  5. What have you changed?
  6. How are we expected to give an accurate answer when we can't see the code? At best speculation, it would be that something in "ajax_user_operate.js" relies on "ajax_check_send_one.js".
  7. Ha.. To be honest I started with w3schools too. Whenever you want to learn something new with JavaScript though, just search on Google. Read a couple of articles/tutorials from different sites to ensure you're not being taught bad things (this doesn't guarantee it obviously, but it's better), which is more likely to make it sink in hearing several different explanations anyway. It's easy to spot someone who's learnt from W3Schools when they post a problem, because their code contains their crappy snippets.
  8. How much data are we talking? If it's a small amount I'd store the islands in an array; the key being the value of the group. When the option is selected, just populate the islands select box using that array. If there's a large amount of data though I'd consider taking an AJAX approach, to dynamically load the islands as you select the group.
  9. Ah okay. What's the logic behind which you show, in English?
  10. Does it not matter which option they select, you just want to show the next select box?
  11. I think you could do this a better way. What's the HTML structure that you're trying to work with?
  12. That is odd.. Does this particular snippet work from your remote sever?
  13. Take a look at my response to one of your other posts. If you were using the same error handling here as you were there, you would have gotten a better error message and solved this instantly.
  14. Have you checked the source to make sure the second argument is added when you expect $assoc['Buttons'] == 'Y' ?
  15. When you say "error code written in the program" - do you mean the HTML you posted below is literally shown as the web page? If so I'd guess you don't have Apache and/or PHP installed and/or running correctly. Edit After seeing your new post I can't understand your problem. Can you try explaining it a little better? What error in what "program" are you referring to seeing (before)? What errors do you get in the error console? etc.
  16. There's nothing within that code Safari doesn't support... Perhaps it's a problem else-where on the page? Do you have this online so we could take a look?
  17. The 'undefined' message is from err.description, because that itself is not defined. Try: txt+="Error description: " + err.message + "\n\n"; Edit Looks like you used a code snippet found on W3Schools - good advise would be not to use that site! Some idiot supposedly capable of teaching people to learn JavaScript has obviously checked the output in their TryIt editor thing, seen the "undefined" message and thought it was on about the undefined function in their example. http://w3fools.com/
  18. Forgot to actually answer your question in my last post... Store the total within a variable, and use the toFixed method to round it to two decimal places: function calculateTotal() { var total = (parseInt(document.getElementById('f1').value) + parseInt(document.getElementById('f2').value) + parseInt(document.getElementById('f3').value) + parseInt(document.getElementById('f4').value) + parseInt(document.getElementById('f5').value) + parseInt(document.getElementById('f6').value) + parseInt(document.getElementById('f7').value) + parseInt(document.getElementById('f8').value) + parseInt(document.getElementById('f9').value) + parseInt(document.getElementById('fa').value) + parseInt(document.getElementById('fb').value) + parseInt(document.getElementById('fc').value)) * 1.50; document.getElementById('total').value = total.toFixed(2); }
  19. Make things easier for yourself and move it all to a function, where you can also structure the code to make it easier to read: function calculateTotal() { document.getElementById('total').value = (parseInt(document.getElementById('f1').value) + parseInt(document.getElementById('f2').value) + parseInt(document.getElementById('f3').value) + parseInt(document.getElementById('f4').value) + parseInt(document.getElementById('f5').value) + parseInt(document.getElementById('f6').value) + parseInt(document.getElementById('f7').value) + parseInt(document.getElementById('f8').value) + parseInt(document.getElementById('f9').value) + parseInt(document.getElementById('fa').value) + parseInt(document.getElementById('fb').value) + parseInt(document.getElementById('fc').value)) * 1.50; } Then change the event attribute to: onchange="calculateTotal();"
  20. If you want help with those issues you'll need to be a bit more clear. Can you show the relevant code for each issue separately, and explain a little better what the problem actually is?
  21. Show us where you define the link object.
  22. Do you want to do this for a certain group of images, or for every image on the page? I can't imagine you'd want to hide any images used for the page's design or structure...
  23. You're also missing quotes around the onclick attribute: onChange=(document.getElementById("body_wrap").style.background=ccGround.options[ccGround.selectedIndex].value) I'd use double, and changes those quotes around "body_wrap" to single.
  24. I use them both at work and for personal projects. The greatest plus point about them in my opinion is that you don't need to worry about cross-browser compatibility - a tedious task for any developer! They're also well-written (the top few at least), so there's no real bloat or performance issues with using them. Every aspect of them just makes things easier though. It doesn't mean you lack the ability to write quality JavaScript, just because you use a framework.
×
×
  • 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.