Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. Perhaps sendmail is not enabled on your live server. I have no idea what code freecontactform.com uses so I can't know why it might not be working. Building a contact form is pretty simple, do you really need to download the code from a third party
  2. There is a right margin on the element, the problem is that it's getting outside of the screen. Remember that the sum of all margins, padding, borders and width cannot exceed the width of the parent element. By giving the class col-xs-12 to your element you're starting its width off at 100%, then you're adding margin and padding on top of it. You shouldn't be using tables there either, just wrap it in a <div> or something similar.
  3. If you're using requestAnimationFrame then you should draw everything each time the method is called. The algorithm you use in the function called by requestAnimationFrame() should determine the rendering order and then render everything. You should only start the animation after all the images have been loaded.
  4. Yes, that Javascript is intercepting the form submission. If it was programmed properly then it would allow the e-mail to be sent without reloading the page. Removing it will make the form work but it will load mailer.php into the browser.
  5. Check the network tab and see what the response to the HTTP request was. The code expects a JSON response and the server probably is returning something different.
  6. Things are drawn from back to front on the canvas. If you want an image to be in front you have to draw it after other things are drawn. If you want to have a single function treat two event types differently you can check the type property of the event object: a.onload = test; b.onclick = test; function test(e) { if(e.type == "load") { // Do something } else if(e.type == "click") { // Do something else } }
  7. All your ourpromise elements are completely invisible no matter what screen resolution I use.
  8. You should have the Javascript console open while the request is happening. There should be information about the request there, on the network tab. Firebug also shows any AJAX requests in the console tab itself.
  9. The issue is a semi-colon inside an object declaration. Just remove the semi-colon. If you remove the whole line then no data will be sent.
  10. It's sending a POST request but not sending any of the form's fields. Do you know Javascript?
  11. Well, the / indicates the location of the file relative to the site root. You need to put the entire path after the slash. I don't know your site's directory structure so I can't tell you what the URL should be.
  12. The information would be displayed in mailer.php of course, which is the file that the browser goes to upon submitting the form. The $_POST array is empty, that's the problem. Is there any Javascript involved in this system? Why are you returning the data in JSON format? If all you had was that HTML and that PHP code then what you have now would work without a problem.
  13. "POST" should be wrapped in quotes. type:POST Have you checked the Javascript console for errors? You should always do that when developing in Javascript. If you're on Firefox I would recommend downloading the Firebug extension, but with or without that, most browsers will display the Javascript console by pressing the F12 key. Instead of alert() use console.log() for debugging, you will see useful information shown in the Javascript console.
  14. What happens when you open the URL to the Javascript file directly in your browser? It seems you're using relative URLs ( "js/jquery-1.11.1.min.js" ), your script tags should be relative to the site root so that they will open no matter what section of the site you're on. You can do that by prepending a slash to the URL ("/js/jquery-1.11.1.min.js")
  15. The echo statement isn't necessary, but it will still work the same. When you submit the form information should be displayed on the page, look at it carefully to see if it matches what you expected to see. You could just var_dump($_POST) as well.
  16. You should remove the @ from these lines of code: $name = @trim(stripslashes($_POST['name'])); $email = @trim(stripslashes($_POST['email'])); $subject = @trim(stripslashes($_POST['subject'])); $message = @trim(stripslashes($_POST['message'])); If any errors are occurring there the @ operator will stop you from seeing them. I suspect your POST values are empty. Try printing out the values to see what you're getting. If you use var_dump() on the values you'll see more information about the content of the variables.
  17. HTML defines the structure of the page, CSS defines the appearance of the page. CSS without HTML is useless, as there is nothing to apply CSS rules to. You have to learn both HTML and CSS.
  18. It is not possible. HTML and CSS go hand in hand, you must learn them both because HTML on its own does not control the appearance of the page, only its content. The bordercolor attribute is deprecated and should not be used. The same goes for all HTML attributes that change the appearance of anything on the page. You should not be using tables to lay out you page either, you should use CSS and the box model for that. Tables are only intended to represent two-dimensional data structures.
  19. Every time you call $('.onoffswitch').load(...); you're deleting everything and putting something new there. All event handlers are lost. Anything inside that element that requires Javascript that runs on page load will not work after that. You should change the content of some other element than the one that's triggering the event. Here's an example of something that will work, perhaps not exactly as you want it to since I don't know what exactly the objective of your code is. <div class="onoffswitch"> <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch" checked> <label class="onoffswitch-label" for="myonoffswitch"> <span class="onoffswitch-inner"></span> <span class="onoffswitch-switch"></span> </label> </div> <div id="switch-content"></div> document.getElementById("myonoffswitch").onchange = function() { if(this.checked) { $('#switch-content').load('/arduino/autoon'); } else { $('#switch-content').load('/arduino/autooff'); } }
  20. Why do you not want to use CSS?
  21. I don't see where canvas, distanceFromRightSide and distanceFromBottomSide are set. From the snippet of code you've provided they're as good as undefined. The easiest solution to your scope problem is to make global variables by initializing them outside of any function, but this will likely end up in conflicts. I don't think the <img> element has x and y properties, you should use something other than profileImg.x and profileImg.y to store coordinates. Here's a small update to your code that should solve some of the scope issues: function drawProfileImg() { profileImg = new Image(); profileImg.onload = function() { var x = canvas.width - distanceFromRightSide - ((profileImg.width - 183) / 2); var y = canvas.height - distanceFromBottomSide - ((profileImg.height - 242) / 2); setInterval(function() { context.drawImage(profileImg, x, y, profileImg.width, profileImg.height); }, 100); }; }
  22. Are you receiving the e-mails or not? The code seems fine to me. You should update $status based on the value of $success so that you can tell if the mail was properly sent or not.
  23. The event handlers get removed if you remove the element. You're deleting and re-creating your left and right buttons every time you click on them You probably should have those buttons in a part of the DOM that doesn't change.
  24. What operating system are you using?
  25. You probably should read through the Javascript tutorial again, because this is something fundamental. Your question is answered in the tutorial.
×
×
  • Create New...