views:

64

answers:

3

Site here.

Basically the box in the middle doesn't generate random string from my database in Firefox as it does in the other browsers. I can't seem to find the problem, my JS skills aren't amazing.

I haven't tested it in IE as I don't have access to it right now.

Any ideas?

Thank you!

+2  A: 

The problem is that form is not defined where you're using it in firefox, you could write it a bit differently to be cross-browser compatible like this:

function get() {
  $('#dare').fadeOut(500);

  $.post ('data.php', $("form").serialize(), function(output) {
    $('#dare').html(output).fadeIn(500);
  });
}

The .serialize() function will take every input element in the form a serialize it, resulting in the same request all the other browsers are making...in a lot less code :)

Nick Craver
that works fantastically, thank you!
Sebastian
@Sebastian - Welcome :) Be sure to accept answers on this and future questions, it'll help you out with an appealing accept rate as you go :)
Nick Craver
A: 

Check the error message in firebug:

form is not defined

$.post ('data.php', {name: form.name.value, mode: mode, player: player}, 
anand
A: 

The following error is generated when you view the site in Firefox:

Error: form is not defined
Source File: http://saucydares.freehostia.com/saucy.php
Line: 29

The line in question is

$.post ('data.php', {name: form.name.value, mode: mode, player: player},

I think the correct method for what you're doing here (if I interpret what you're doing here correctly) is to obtain the form's name with jQuery.

Yi Jiang