Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. Are you getting any Javascript errors in the console? Check to see whether the program is actually completing the request by logging data from inside the readystatechange handler: xmlhttp.onreadystatechange = function() { console.log(xmlhttp.readyState, xmlhttp.status); if(xmlhttp.readyState == 4 && xmlhttp.status == 200) { var return_data = xmlhttp.responseText; console.log(return_data); document.getElementById("demo").innerHTML = return_data; }} On this forum, wrap your code between [CODE] and [/code] tags so that we can see it properly.
  2. Find a folder called "htdocs" or "public_html" in your xampp folder and put the PHP file inside there.
  3. The same procedure as all prepared statements: 1. Prepare 2. Bind 3. Execute I assume you're using MySQLi, you haven't specified. This code works if $connection is a MySQLi object, if it's PDO the syntax is a bit different. $stmt = $connection->prepare('SELECT serviceID from services_list,appoint_servi_chosen WHERE services_list.serviceID=appoint_servi_chosen.service_ID and appoint_servi_chosen.app_ID=?'); for($j=0;$j < count($appdata);++$j) { $stmt->bindParam('s', $appdata[$j]['apID']); $result1 = $stmt->execute();} Unless you need $j for something, you could just use a foreach() loop foreach($appdata as $d) {$stmt->bindParam('s', $d['apID']);
  4. There are things Javascript just can't do. If you want to be a web developer you have to learn all the necessary technologies. Javascript can manipulate objects on the page, including form elements, but it cannot save the data onto the server. A server-side language is required for that. This example will show you how to read the data from a form field in Javascript: http://www.w3schools.com/js/js_validation.asp You can save the data you read into a cookie or localstorage, but you will not be able to access that data from any other computer than the user's own computer.
  5. Set the width of the left column to the value you want. Float it left. Set the left margin of the right column to the same value that the width of the left column has, but adding the padding and margins of the left column to that value. Don't specify a width for the right column.
  6. You haven't shown us an example of your code.
  7. Forms submit to a server-side program which can operate with the data, save the data in a file, or in store it in a database. You could start by learning PHP.
  8. Ingolme

    Rule @face font

    I assume this is the font he's using: http://www.fonts.com/font/linotype/avenir The filename doesn't necessarily have to match the font name.
  9. Ingolme

    Rule @face font

    Just for testing, TTF alone will work for all recent version of browsers. See compatibility table here: http://www.w3schools.com/cssref/css3_pr_font-face_rule.asp I suspect it wasn't working because he forgot to assign it to an element. body { font-family: Avenir;}
  10. It's part of object-oriented programming. W3Schools doesn't explain it because it's complicated. The PHP manual goes into detail about it: http://php.net/OOP
  11. They are block elements. Block elements always take the full width of their container and they stack vertically, so one is ontop of another and they don't share horizontal space. What you could do is to float them left and give them a 33.33% width. You would have to remove all margin and padding for that. You can put margin and padding on elements inside the boxes.
  12. All the selectRound() function does is change what the tiles look like. Not their order or position. Whenever you want to change the appearance of the tiles, call selectRound() and pass an array with new images for the tiles. The algorithm that puts the tiles on the page and orders them is unrelated to what the tiles look like.
  13. What's happening is that the images array only had numbers 0 to 3. So only images p0.png to p3.png will be assigned to the tiles. My proposed solution would be to reorder the tiles array and reposition the <img> elements in the document rather than try changing their src attribute.
  14. jQuery's great for animations, but if you want to make a videogame I suggest forgetting about jQuery because for a videogame you need to do operations and comparisons on each animation frame. Videogame programming is not simple.
  15. localStorage won't display anything visually. It's purely for saving data so that it's available in the future. Your function has some problems: 1. Variable count is not defined anywhere. 2. This expression is a syntax error because of that stray zero: 0(localStorage.clickcount) + 5; 3. The textField variable is not being used anywhere. You're setting its text color to blue, but doing nothing else with it. Is your function being called from anywhere else in the page?
  16. Ingolme

    Quirks Mode

    In quirks mode, browsers behave as they did in the early days of the web. This was done to prevent old sites from breaking too much in new browsers. Using a non-standard <!DOCTYPE> will cause every browser to run in quirks mode. But not all browsers behave the same in quirks mode, each browser reverts to its own unique rendering engine which is why it's very difficult to get a page looking alike in different browsers. The only standard doctypes today are HTML 5, HTML 4.01, XHTML 1.1 and XHTML 1.0. They are listed here: http://www.w3schools.com/tags/tag_doctype.asp I do not recommend using anything other than HTML 5 these days.
  17. This is what your Data URLs are looking like: blob:http://fiddle.jshell.net/d4f30ebe-6b19-449d-879e-1c9d13f4253e I don't really know how blob URLs are meant to work. Is this what you expected your program to make? toDataUrl() is probably the right solution: imagePieces.push(canvas.toDataURL()); But this triggers an error because the image is loaded from a different domain. In order for it to work the image and the HTML file need to be hosted on the same website.
  18. Ingolme

    Charset problems

    Change the escape() function for encodeURIComponent().
  19. Before loop: $total = 0; In loop: $subtotal = $row['a']+$row['b']-$row['c'];$total += $subtotal;
  20. Give a class name to your <td> elements. Then you can use CSS to set the text-align property to left or right based on which class you used. For example: <tr> <td class="text">This is a line of text</td> <td class="number">123.00</td> <td class="number">45.00</td> <td class="number">123.99</td></tr> In your stylesheet: td.text { text-align: left;}td.number { text-align: right;}
  21. There's far too much to explain in just one forum post to build something like that. It's an entire project in itself. That is why you can find somebody who has already built something like that: https://www.google.com/?gws_rd=ssl#q=jquery+datepicker If you have to ask how you could build it from scratch , there's just too much you have yet to learn about Javascript. If you truly want to learn enough to do that, set yourself simpler tasks to practice and continue reading tutorials and documentation.
  22. Learn to access and manipulate elements of the page using the DOM. Here's the tutorial page for that: http://www.w3schools.com/js/js_htmldom_methods.asp Continue reading from there. document.write() won't get you very far. It can put new things on the page, but it won't change what's already there.
  23. Do you have any idea what the program does? I can't know, because you haven't given the full specification of what you're trying to achieve and a lot of your proposed solutions don't make much sense. You have three different arrays with different data. tiles: a list of references to HTML <img> elements. images: a list of integers. round1, round2... etc: A list of strings representing filenames. What the round arrays do, and all they ever need to do, is replace the images for new ones at the very beginning of the match. After that, forget that round exists. Everything else you do with the tiles depends only on the tiles and images arrays. It looks as if you're trying to reorder the tiles when one game ends. If that's the case, I need to know which part of your code determines the order of the tiles, and also what order you want to set it to.
  24. Use CSS and set the border-collapse property. You should make sure you're writing valid HTML using the W3C validator.
×
×
  • Create New...