user3281829
user3281829

Reputation: 17

How would I call a function in jquery if $_GET was not set?

Maybe something like this:

<script>
$(document).ready(function(){
<?php
if (! isset($_GET('/*variable*/')){
  echo '$("#toggle1").click(function(){';}
?>
    $("#n").slideToggle("fast");
    $("#p").hide();
  });
});
</script>

Is this possible and if not is there any way that it is possible?

Upvotes: 0

Views: 226

Answers (1)

Paul
Paul

Reputation: 141827

Yes it's possible:

<?php if (! isset($_GET('/*variable*/')): ?>
  $("#toggle1").click(function(){
    $("#n").slideToggle("fast");
    $("#p").hide();
  });
<?php endif; ?>
});

Upvotes: 2

Related Questions