Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Hi I am a Snake posted:

Two alerts come up: the first reads "undefined" and the second reads "100". Why aren't they the same?

Because this does not refer to bob. I'm not sure why you think it would, really. The onclick event you specified has nothing to do with bob at all.

Adbot
ADBOT LOVES YOU

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
Anyway, if you want something like bob.test() you need to specify test as a method:

code:
function stat(value)
{
    this.value=value;
    this.test = function() { /* ... */ };
}

// or

stat.prototype.test = function()
{
    // ...
}

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

noapparentfunction posted:

I appreciate the help. I was looking at my code and I realized that I wrote my tables mainly in plain HTML. How do I add overflow: hidden in that case?

Give them ids or classes. Or come up with a CSS selector that targets only the tables you want, e.g.
code:
table td
{
    overflow:hidden;
}

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

noapparentfunction posted:

Thanks for the suggestion. I just tried creating a second set of links at the bottom using onClick containing the same functions as the buttons. They don't seem to work though. Any other ideas?

Look at the number of quotation marks in this (underlined for emphasis):
pre:
<a href="#" onclick="function() {
                $(".widearea").animate({
                        marginLeft: "0px"
                }, 500">art.</a>
Also, you should be doing the same thing you did with your buttons. Just give them an ID.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

noapparentfunction posted:

Thanks for the help. Should I get rid of those quotation marks or replace them with a different character? I tried removing them and the links did not work. Also, I don't know how to assign an ID to the links like I did the buttons, so if you could help me with that I'd appreciate it.

You can use single quotes if you like. Also, adding an ID to an "a" tag is exactly the same as adding one to a "button" tag: id="butts". As usual, each ID must be unique on that page.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Ether Frenzy posted:

Here's what did the trick:


code:
...
:cheers:

A-are you seriously doing validation on the client side? :barf:

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

royallthefourth posted:

Seems fine to me if it's there to complement existing server validation.

Yeah, I don't think "putting the list of valid (presumably secret) codes in Javascript" counts as "complementing server validation".

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

ronin109 posted:

However, all of this is moot if you actually intend to do (presumably secret) reference code checks since, as Avenging Dentist points out, that should be a server-side only check to avoid putting the "secret" answers in the source code of the page.

Secret-code validation done on the client side would make a pretty good captcha for a programming website though. :xd:

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

G-Dub posted:

Is there an equivalent function to unescape or tostring(16) in VB? And does the ^ symbol mean to the power of, or does it have another use? Apologies for not having a clue.

1) That code is awful, and trying to replicate it in VB will make it at least as awful (probably more so).
2) The entire CharCode function is stupid and unnecessary
3) ^ means bitwise XOR, as the Encrypt function implies.
4) Do you mean VB6 or VB.NET?

EDIT: For fun, this is how I'd do that (which requires JS 1.8 but if you aren't using Firefox 3, you don't deserve encryption)
code:
function encrypt(clear)
{
   var magic = "The Magic String XOR";
   return Array.prototype.reduce.call(clear, function(prev, curr, i) {
      var c = (charCode(curr) ^ charCode(magic[i])).toString(16);
      if (c.length == 1)
         c = "0" + c;
      return prev + c;
   },"");
}

function charCode(char)
{
    if(char == undefined || char.length == 0)
        return 255;
    var code = char.charCodeAt(0);
    return (code>255) ? 255:code;
}

Avenging Dentist fucked around with this message at 21:20 on Sep 7, 2009

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
Comedy "make your own scrollbar in HTML and synchronize everything so it updates simultaneously" option.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
A cursory look at MSDN says the Matrix property should work.

Adbot
ADBOT LOVES YOU

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

awdio posted:

Sorry, I didn't mean to leave the "eval" in there in the 2nd example. Anyway, OddObserver, your example works. Thanks!

Please tell me there's a good reason that transVideoCopyToCopies isn't just an array.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply