Jump to content

Jack McKalling

  • Content Count

  • Joined

  • Last visited

Everything posted by Jack McKalling

  1. The javascript reference contains pages for all object types, like Array, Boolean, Date, Math, String. But not Object itself. There is a page for "Global" properties and functions, "Operators" and "Statements", but things like Object.create(), Object.values(), Object.keys() etc aren't on any of those pages either. Are these methods not documented because of lack of support on W3Schools for the relevant javascript version, or can Object be added to the reference pages? I'd like to see Object documented here, and not need to go to the MDN. Thanks for letting me know *Edit: I phr
  2. For some reason the W3Schools website is not reachable in IE8. It simply gives a direct HTTP error and I cannot view any page. However the forum works just fine, but that is on a different domain anyway. Why is this? Is this a decision from W3S, to kick browsers that are too old, or is it some browser setting I myself overlooked? Because I find it very weird that W3S, who themselves are teaching how to be cross-browser, are not even compatible at all with this one. I was just trying to figure out whether I should be using the "lightgrey" or "lightgray" colourname, and I know IE8 is the
  3. Hey, wonderful! New wow looks
  4. So you see, it all comes down to our definition. I never really agreed with wikipedias statement there because I thought OOP was only really a meaningful term if it is distinguised from classless programming (most languages work with objects anyway). This prototyping of JavaScript is quite different from my definition here, and though both methods could have their pros, I think I prefer the latter. But I don't want to start a discussion on which is better, I only need to point out I should have phrased myself from the start. Like this:Programmers who are (only) used to define classes like in e
  5. From my definition, prototyping has nothing to do with OOP. It may provide a means to create objects and such, but does this mean it is OOP? As previously mentioned JavaScript saves almost anything as objects. But compared to Java, C#, or even PHP's OOP implementation, JavaScript really isn't object oriented, right?Though it's often proven that some of my definitions are somewhat off to what's usually accepted, and that may apply here too. But it doesn't mean I never have my reasoning. I might seem off or backwards, and you're probably right, but when I mention OOP, I refer to using class defi
  6. @ShadowMage,The reduction in parameters is what I also had in mind, but I thought just to first show the idea of parametering what was already global. I didn't know setTimeout() also accepts an anonymous function though, thanks! The tutorial doesn't explain the type of that argument quite clearly (they call it a "reference", but use a string in their own example). And what stupid of mine, default values of parameters, lol. I haven't been using either PHP or JavaScript for a while now, obviously I'm mixing things up a little here.I fully agree with you that the custom function is confusing. If
  7. I believe you might write this function completely using parameters, eventhough you're using the setTimeout() function.Bear in mind the setTimeout() requires you to pass the function call as a string argument, as this means you can't simply pass in arguments to your function normally. You have to include the result of any argument into that string, which I present here: <script type='text/javascript'>//var text; //not necessary anymore//var texttobePlaced;//var theLoop = 0;function generateText(text="", textToBePlaced="", theLoop=0) { text = document.getElementById('thetext').va
  8. I don't know if global variables make your browser slow, but it does provide the certain danger of conflicts between scripts that you installed together. A global variable should not be used by multiple functions unintentionally, and if they are global, this is precisely what would be possible.In my opinion, it should always be visible where a variable comes from, and in what scope it is active. In OOP this is quite obvious if you fully qualify them, but in javascript, there is no such thing. So to keep things readable, I'd say just try to use just the one scope of every function, and not the
  9. That's right. I totally forgot about "normal use" of objects and assumed the use was referring to OOP.I think my only use for global variables is/was for preloading images with javascript, but then again, I don't use that anymore either because of the sprite-technique.My own reasoning behind not recommending global variables is that this scope is used to declare functions only, in the head section of your page. I see this section as a declaration of modules, and no actual execution of code.
  10. But I suppose if multiplication or addition is all you want, you probably don't need both of these values returned by the same function at the same time. For other cases, this is the way to do it though.There is another option to 'return' multiple values, but this is more like a hack and better done in OOP context.You can instead of hard returning a value, also change a variable or property that was created outside the function scope. If you change such a value from within the function, you don't need to return it from the function as it is already avaliable outside. This is not recommended pr
  11. Correct, the return-statement returns code execution, so really any code that follows it is skipped. You cannot return multiple values precisely because of this, the only way of doing so would be by combining the values in one value, like an array (like Deirdre's_Dad explains below). You can also make the calc(x,y) function callable with a third parameter that is of boolean value, to indicate whether you want to add or multiply, and return the appropriate value by conditioning on the value of this parameter. <head><script type='text/javascript'>function calc(x,y,multiply) {
  12. Just as I explained, the onsubmit handler is using a value. If you return false from it, it will of cource cancel the event, but if you only call a function, it will not, regardless of the return value of that function. Unless you RETURN the return-value of the function like in above example :)This might seem a little weird for you in the beginning. But this eventhandler is, if you want to know, a separate code scope from the event itself. It will only cancel the event if it returns a value, just like your function does. If the handler calls a function itself, the return value must be returned
  13. You'll also want to return the value of the function to the event itself, simply calling it won't be enough in my experience.Using your example, the code will look like the following, taking ShadowMage's correct suggestion in account: <head><script type='text/javascript'>function denySubmit() { alert('you will not going anywhere'); //but the the form will now NOT load the 'lol.php' return false; }</script></head><body><form action='lol.php' method='get' onsubmit='return denySubmit()'><input type='text' name='myText' /><input type='submi
  14. Hello,I'm new to using (MySQL) databases through Eclipse, and would like to know how it's done.Currently I have my project for a windows application. It's fully written in Java. But to distribute the app, I'm using an executable wrapper that packs up the jar and necessary files into one exe, and then I rar it along with some gfx and sfx folders into one nice archive. The idea is that I further develop this windows application using a MySQL database (which I hereby want to start using), untill I port it to an applet for websites and then switch to an existing online MySQL server. If it is possi
  15. You're right about the origin of this account, did you remember that? But you're slightly inaccurate about the irony part. We had an aggreement that I should take over all of his work and memberships, and continue on his ideas for a website. I quite did not force it, in fact, I was given permission. This was all a long time ago though, long before the post you refer to.It may seem a little confusing, I understand. But I don't really want to talk about the origin. I'm the only one now, and anything that has recently come up as one of my threads is in fact really mine. I wouldn't have posted my
  16. Thanks Sigord.It is indeed a good question why people publish supposedly private material. In the case of my own posts here, I really cannot help it or do anything myself to prevent infringement. I would have a question that I submit to this board for the technical answer it could receive, but my posts are not hidden to the public. W3Schools leaves the forums open for guests to read, as the community here isn't supposed to be closed eventhough individual posts might claim privacy.However, as you've pointed out, (almost) all material on the internet is automatically copyrighted. Should I assume
  17. Hello,Sorry if this is the wrong forum, it was really hard to decide.Last notification I received about a new reply to one of my topics, gave me a warning that the message might not have legitimately been sent by gmail. I've read Gmail's helppage, and now I forward it to you. Can you do something about it, or should it be presented at IP Boards?Gmail says it is possible to add specific information to the message headers, but that's not my best field of expertise.A reason why this should be looked into, is that it might help preventing a classification as spam.Thanks for your help,Jack
  18. Aye, I wish the internet provided more security.No need for policing, but definately no need for thieves either.
  19. No of cource not. I don't mind websites taking my posts, it's my name that was in it.I am glad that my name is an alias in the first place, but it just doesn't feel right that it appears on a site that I've never visited.*Edit:Oh yes, sorry. This contradicts my first post. I just mean that whenever I submit a text that actually has my name in it, I would want the occurance of this text to credit the name. You wouldn't want to be mentioned anywhere without appropriately being addressed.Other than that they can keep my posts, just not those with my name in it or without due credit.Content scrape
  20. I didn't know W3Schools didn't control the server. I assumed the software was installed on their own, but looking at the domain, I should have known this.Contacting Invision Power seems a bit too far for this thing, I guess it would have been okay if W3Schools could have just done this. It doesn't matter though, if you're right, and that is what spinn3r said, Omgili is probably the same.As robot.txt is not a secure lock or a lock at all, if we really wanted to protect our posts here we should look into other means. There is one thing that comes to my mind, but this will probably hurt ourselves
  21. It's fairly possible they lie about robot obedience. But it all seems legitimate, judging the whole website. They themselves mention the robot they're using and how to disable it, and I wouldn't think non ligitimate websites would do that. They're just a website delegating forum posts within their "search platform", and it seems they're just offering a backdoor for those who don't wish to participate in it.Maybe they are lying, but if they are, trying to disable the bot would not hurt anything, right? I see the possibility. My glass is half full :)I forgot how to contact W3Schools though.
  22. After my recurring check, I've now found Omgili too.This Omgili is some site who claims to be a search engine, and lists more than one of my posts accessible by google search.But this time I know what could be done about it.Omgili says they will obay "/robots.txt", and with a mention of the "omgilibot", I, and I mean W3Schools, could tell Omgili to stop indexing.So this is my question to W3Schools, are you using /robots.txt, and if so, could you modify it to deny Omgili? It's just one bot, but it helps. Maybe we can't take down infringing content, but maybe we can prevent anything further. It'
  23. So I see. Well my argument is that my name is used, in combination with my company name.Anybody can do anything with the information without knowing it is me. Over here I can just edit or delete it, but not over there.Its just that I want to protect my privacy. For instance, if you google my name, you'll only find posts on forums that I am a member of and my own website, but nobody else. That is not a coincidence...
  24. Hello, I have found a copy of a post from my writing, somewhere on the net.I am claiming the text there, I wish it to be removed, as I wish not to be not credited for any texts I write here.Still I wonder how copyright is handled on these forums, and what my rights are...Can anyone help me?Reference: http://ebookslab.info/free-tutorials/doctype-addition.htmlOriginal: http://w3schools.invisionzone.com/index.ph...st&p=177738*Edit:Another reference of the same post somewhere else: http://www.globberstack.com/Questions/doctype-addition-1/*Edit2:I've edited my name out of the original post, so
  25. Okay, so that is a little too complicated..Basically, (how) can you set a child of a 100% windowheight element, to fill its remaining space vertically (if there is also another sibling above it)?And I'm not looking for margining the child to cascade the other sibling from behind, I want this child to overflow:auto, without that scrollbar to disappear behind something else..
  • Create New...