Jump to content

mortalc

Members
  • Content Count

    146
  • Joined

  • Last visited

Everything posted by mortalc

  1. I looked at the HTML5 tutorial recently and noticed the "canvas" tag. I did a quick google and it has been heralded by many as the replacment of Flash. However, there is not nearly enough information to merit that. I also discovered many amazing webpages using canvas, so I would think it would be a good idea for a tutorial.
  2. I thing fromCharCode would be a good idea, but you can't use switch on a number, so it would be less efficient.
  3. I didn't use an iframe this time. I used the SVG file on its own.
  4. Gah. Ok, I need someone who is skilled at SVG to tell me why this isn't working: <?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN""http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" version="1.1"xmlns="http://www.w3.org/2000/svg"onkeypress="move()"onload="move()"><script type="text/javascript"> <![CDATA[ var x; var y; function move() { x = new Number(svg.getElementsByTagName("circle")[0].getAttribute("cx")); y = new Number (svg.getElementsByTagName("circle")[0].getAttribute("cy"));
  5. I've just discovered that you can include JavaScript in SVG! This is good news!
  6. it's still not working...I think now a problem in my XML DOM syntax. Here is my modified code:<!DOCTYPE HTML><html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script type="text/javascript" src="LoadSVG.js"></script> <script type="text/javascript" > var balls = loadSVG("ball2.svg"); function moveLeft() { var x = balls.getElementsByTagName("circle")[0].getAttribute("cx"); var z = new Number(x); z--; x = z.toString(); balls.getElementsByTagName("circle")[0].setAttribue("cx", x);
  7. I suspected as much (about the third point) - I think you're right about the iframe not updating. I just did some research and the iframe object has a reload function. so thankyou!
  8. Gah! Debugging time again.HTML page: <!DOCTYPE HTML><html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script type="text/javascript" src="LoadSVG.js"></script> <script type="text/javascript" > var balls = loadSVG("ball2.svg"); function moveLeft(obj) { var x = obj.getElementsByTagName("circle")[0].getAttribute("cx"); var z = new Number(x); z--; x = z.toString(); obj.getElementsByTagName("circle")[0].setAttribue("cx", x); } function moveRight(obj) { var x = obj.getElementsByT
  9. Ok, to make sure I understand it: If I use this code, and type in a, some code will run, but if I type in, say, b, some other code will run: <script type="text/javascript">function check(){if(event.keyCode=="a"){//execute some code}else{//some other stuff}</script><input type="text" onkeypress="check()"/>
  10. Ok, Is there a way to detect a specific key press?I have thought about it, and I think there are two possibilities: Detect a keypress in general (i.e. with onkeypress or $(selector).keypress()), and execute a function, which identifies the key pressed, and then executes another function if the key is the intended one. Have a custom event, so to speak
  11. mortalc

    SVG

    Ok! Thanks!
  12. mortalc

    SVG

    Hrm... Just in case, where is the SVG DOM tutorial?
  13. mortalc

    SVG

    Ok, now a question - What would I use to create an interactive SVG?XML DOM?JavaScript?Name the name, and I'll go learn it.
  14. mortalc

    SVG

    Never Mind! I have fixed it! HUZZAH!
  15. mortalc

    SVG

    I don't know if this is the right place to ask about SVG, but here goes.I've created this code for a circle moving up and down in a square. But for some reason, it isn't moving. <?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN""http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" version="1.1"xmlns="http://www.w3.org/2000/svg"><rect x="0" y="0" height="500" width="500" style="stroke-width:1; stroke:black; fill:white"></rect><circle cx="250" cy="50" r="50" stroke="red" stroke-width=
  16. mortalc

    Form

    Sorry, I was ambiguous. I meant writing to the text document, i.e. sending the post to be retrieved.
  17. mortalc

    Form

    Ok, so I'll need something like if(Xrequest.readystate=4)?And What about the problems I am having at writing to the document?
  18. mortalc

    Form

    1. No error reports.2. the if() function is to make sure the same thing isn't posted twice.
  19. mortalc

    Form

    Ok, I have made all of the corrections, and it still isn't working. I've also discovered that newmsg.txt is being changed occasionally, but for a while now it has been the same.
  20. mortalc

    Form

    Aa-ha! You almost had me there...Ok, I will correct those errors and get back to you. Thanks!
  21. mortalc

    Form

    Ok, I have tested it and I know that everything is working EXCEPT for the bit which retrieves the text.I have this webpage in an <iframe> on the chat popup screen. It is the part which displays the text. Or should. <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <script type="text/javascript" > var Xrequest= new XMLHttpRequest(); function check() { var x; Xrequest.open("GET", "newmsg.txt", true); Xrequest.send(); if (!(Xrequest.responseText==x)) { document.write
  22. mortalc

    Form

    Ok, thanks everyone! I will let you know if it works.
  23. mortalc

    Form

    Thank you very much, Mr. Bibal.So a PHP file can run even if it isn't the current page?
  24. mortalc

    Form

    I'm sorry for not explaining.This is what I can do: Update the chat window every new post (from any user)This is what I can't do: Send the reply off to the file on the click of a button (or even better a press of enter), without refreshing the page.In PHP I know how to send the text but not retrieve it from the textfield.In JavaScript, I know to retrieve the text but not how to send it off.Another thing is that I need to be able to delete the contents of the file before, and 1 second after, the text is sent. I can do this easily in PHP but not in JavaScript.Ok, now you know what I am trying
×
×
  • Create New...