douyan3478 2015-08-31 16:33
浏览 59
已采纳

在if语句中执行jquery

I got a login system, and what I want to do is to hide a div and show another div when the user types the incorrect login details. However it doesn't seem to work.

if(...) { // here I check if the user enters the correct information

... //much code inside

} else { // if incorrect info, do this
    echo "<script>$('#jqueryhide2').hide();
        $('#jqueryhide').show();</script>";
}

Tried to google a bit but can't find anything that could solve my problem.

  • 写回答

3条回答 默认 最新

  • douling8087 2015-08-31 16:45
    关注
    put this code and also include your Jquery file -(dont forget)
    echo "<script>
    $('document').ready(function(){ 
    $('#jqueryhide2').hide();
    $('#jqueryhide').show();
    });</script>";  
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。