0

if i have [ if statement ] in my php code than with jquery it is not working...........!!
e.g
if i have
---------------------------

<?php
if(myquery){
}else{
do jquery here
}
?>

------------------------------

but jquery in else area is gone disable how can i fix that.........!!

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by gamingdrunk
0

Not quite sure what you mean... You cannot put jquery code inside php code. If you mean something else, please try explaining with some more detailed code.

0

i have done it and by the way we can add jquery code inside php code............!! any way thanks for replying...........!!

0

I'm not sure I understand what you are wanting, but if I am correct you should be able to do something to the effect of this.

<?php
if (myquery()) {

} else {
?>
<script type="text/javascript">
$("#somediv").someJqueryFunction({some: 'json', data: 'parameters'});
</script>
<?php
}
?>

I would prefer to see the jquery in a separate .js file though and pass it using the source parameter for the script tag.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.