Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. <iframe width="854" height="510" src="http://www.youtube.com/embed/RCImd8vZWG4" frameborder="0" allowfullscreen></iframe> My tests conclude that the code works in versions of IE down to 7. Just make sure you add http: to the URL, which is not present in the code you showed in the third post.
  2. What do you mean when you say it does not execute $_SESSION['cerr'] ?
  3. What format are the videos in and what version of IE?
  4. You just need one single session_start(); at the beginning of the page, I can't predict how it's going to behave if you call it more than once. As for the location header, if you're changing session variables you need to save the session before sending the header. This is done using session_write_close(). Normally, this method is implicitly called as soon as the script stops running, but if you send a location header then the browser will leave the page before it has finished executing the script, so the session variables are never saved. To be safe it's preferable to have the die or exit statement after the header. In summary: session_write_close();header('location: register.php?')exit; And be sure to only call session_start() once at the very beginning of the document.
  5. Here's some information I found http://en.wikipedia.org/wiki/Pretty_Good_Privacy https://support.mozilla.org/en-US/kb/digitally-signing-and-encrypting-messages I believe that the code is there in the e-mail so that you're able to manually verify that the message hasn't been altered or something like that. I'd have to do further investigation, but it's certainly nothing harmful.
  6. If it's a block element, like <div>, give it a specified width and then set the left and right margins to "auto". It it's text, or an inline element, then set text-align to center on the parent element.
  7. I see the problem. Firefox, by default, assumes that a button element inside a form is a submit button. Two things: 1. Since you're not actually using the form, don't use a <form> element, just put it in a <div> or another more suitable element. <form> elements are only for sending data to a new page. The lack of an action attribute makes the form submit to the same page. 2. If you insist on using a <form> element, add the attribute type="button" to your button to explicitly specify it's not a submit button.
  8. I believe it's a security measure used to confirm that the e-mail was sent from the right person. I'm quite sure it's not an attempt to hack you.
  9. Ordinary objects are created using JSON syntax, or the old way, using the new Object() constructor. // Old way:var obj = new Object();obj.property = "something";obj.method = function() {}// JSONvar obj = { property : "Something", method : function() { }};
  10. Have you checked the error console in the browser?
  11. HTML5 is the better option. Flash is becoming obsolete. Flash doesn't have DRM either. Anybody can use a Flash decompiler to take your source code, from my experience even 14-year-olds have enough knowledge to decompile a Flash program. If you want to protect your source code, use the legal resources at your disposition. Here's an HTML5 based version of the application: http://iscribble.net/
  12. Technically the private variable is not part of the object, it's not really a property at all. It's just a variable that is local to the function: the object is actually just a function on which you're allowed to append properties using this or prototype. The variable created using the var keyword is in a different scope than a property that is added to the object using this.
  13. In your example, you never had a line saying this.personProperty="personPropertyValue"; so it was undefined. The var keyword creates a completely differen variable than the this keyword does. // Inside one object:var myVar = 5;alert(this.myVar); // Shows undefined// Inside another object:this.myVar = 5;alert(this.myVar); // Shows "5"
  14. No, not natively. Some people built a library called Backbone that was meant to emulate object-oriented programming in Javascript, but I feel like it's an unnecessary layer of abstraction. I understand people like to continue programming in a way they're familiar with, but if you want to use Javascript most efficiently it's best to learn Javascript's own programming style.
  15. Use an <xsl:choose>. If @PartyCurrent is "true" then show "true", otherwise show "false". <xsl:attribute name="ext:currentIndicator"> <xsl:choose> <xsl:when test="@PartyCurrent = 'true'">true</xsl:when> <xsl:otherwise>false</xsl:otherwise> </xsl:choose></xsl:attribute>
  16. You already have a thread for this question here: http://w3schools.invisionzone.com/index.php?showtopic=52146
  17. If that's the case then all you really need in your script is a toggle. Instead of passing the literal string "default.php" to the load() function, pass a variable that alternates between "default.php" and the other filename each tine the function is called. The simplest way to do it is storing the name of the last page you loaded in a global variable. // Global variablevar page = ""; // Inside the event listener if(page != "default.php") { page = "default.php"; } else { page = "acman.php"; } $('#main').fadeIn(1000).load(page); nxt(); If you have Javascript inside the page you're loading there's going to be a conflict between the script on the current page and the script that has been loaded.
  18. In these objects, using var and using this create two different properties, one accessible from outside and one private. If you didn't create the variable using "this." then you can't access it using "this" function Person() { var self = this; var name = "A"; this.name = "B"; this.getPrivateName = function() { return name; } this.getPublicName = function() { return self.name; }} Anything that is not created using "this" is not accessible outside, it's a private method or property.
  19. You would create a new object for the SubPerson's prototype because if you don't, any changes to SubPerson's prototype will also modify Person's prototype. They're both pointing to the same object.
  20. There is no built-in inheritance in Javascript, but because Javascript is weakly typed it's not that important because you're capable of having arrays with more than one type of data in them and function parameters don't have any type assigned to them. As for composition, you're allowed to assign a different object to an object's property. function MyObject1() { this.obj = new MyObject2();}function MyObject2() {} There's a good description of the instanceof operator on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof In general, instanceof only returns true if you give it the function that was used to create the object with the new operator.
  21. For some odd reason, functions are able to behave like classes in Javascript. This is helpful. I'm not entirely sure of the reasoning behind implementing it this way, but all browsers do it like that so developers take advantage of it. If you use a function instead of the Object() methods you're capable of giving the class a name, private properties, public properties and methods. function MyClass() { // The methods of this class might be called in another context which would cause "this" to point to something else // So we assign a reference to this object in a new variable var self = this; // Private property var privateProperty1 = 0; var privateProperty2; // Public property this.publicProperty1 = 5; // Private method function privateMethod1() { privateProperty1++; } // Privileged method (has access to private properties and methods) this.privilegedMethod = function() { self.publicProperty1++; privateProperty2 = "A"; }}// Public method (does not have access to private variables and methods)MyClass.prototype.publicMethod = function() { this.publicProperty--;}
  22. It's called pagination. You use the LIMIT clause of the query to only load a particular set of results based on what was passed to PHP in the query string.
  23. The string replace method only changes the first match found. If you want to change all of them you need a global regular expression. .replace(/Linux/g, "Windex"); The for loop you made is just doing an assignment, it's not actually manipulating the string.
  24. You use one of PHP's database libraries to communicate with a database using SQL. This section of the PHP tutorial explains how to do it: http://www.w3schools.com/php/php_mysql_intro.asp
  25. The reason you should not be using all the content from the page you're loading from is because you're adding additional <!DOCTYPE>, <html>, <head>, <title> and <body> tags in places they're not meant to be. Read this page of jQuery's documentation: http://api.jquery.com/load/
×
×
  • Create New...