Jump to content

jQuery code not working without alert function

- - - - -

  • Please log in to reply
3 replies to this topic

#1
datalogi

datalogi

    Newbie

  • Members
  • Pip
  • 6 posts
Hi,

I can't get the following jQuery code working without putting alert() function before $.get()

Could you please help me?

Code:
function hae_kommentoitava_teksti_erinomainen() {

randomNum = Math.ceil(Math.random()*10000000);

// alert();

$.get("hae_teksti.php?ID="+ID+"&randomNum="+randomNum, function(data){

var StringInArray = data.split('|');


if(typeof StringInArray[1] == 'undefined')
{
$(".question6").hide();
$(".question7").hide("slide", { direction: "left" }, 1000);
$.doTimeout( 'someid', 1500, function(){
$(".question8").show("slide", { direction: "up" }, 1000);
});
var tarkistuskoodi = 7;
hae_kommentoitava_teksti_kehityskelpoinen(tarkistuskoodi);
}

else
{
$('.kommentoitava_idea').html(StringInArray[0]);
idean_numero = StringInArray[1];

$(".question6").hide();
$(".question7").hide("slide", { direction: "left" }, 1000);
$.doTimeout( 'someid', 1500, function(){
$(".question7").show("slide", { direction: "up" }, 1000);
});
}
});
}

#2
Vaielab

Vaielab

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 547 posts
Are you waiting for jquery to be completely loaded?

put your code inside this

$(function () {

//Code goes here

});


#3
datalogi

datalogi

    Newbie

  • Members
  • Pip
  • 6 posts
Yeah, my code is already inside it.

Despite of that it's not working...

#4
Vaielab

Vaielab

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 547 posts
If your code is already inside this, it mean, we don't have all your code, and so make it hard to help you... we can only guess
And my only other guess, is that jquery is loaded, but maybe not jqueryUI.
With firefox & firebug, in the net console, do you see the get request?




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users