getElementByID与document.reffer吗? [英] getElementByID with document.reffer?

查看:91
本文介绍了getElementByID与document.reffer吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Java和php的新手.我有一个表单,它通过一些php mumbo jumbo.之后,我检查数据库以查看登录凭据是否存在.如果没有,我想显示一个包含错误消息的div.

I am new to both Javascript and php. I have a site with a form that goes through some php mumbo jumbo. After that, I check my database to see if the login credentials exist. If they don't, I want to show a div that contains the error message.

oldURL = document.referrer;
console.log(oldURL);
if (oldURL =="http://amazingwebsite.com/") {
    document.getElementById("loginfail").removeAttribute("hidden");
    document.getElementById("textlogin").removeAttribute("hidden");
}

oldURL返回我if语句中的确切URL.但是,仅当我将oldURL设置为不等于"(==!)时,if语句才有效.

oldURL returns the exact url that I have in my if statement. However, the if statement only works if I have oldURL to 'not equal' (==!).

我错过了什么?

推荐答案

感谢@ T30,我知道了.显然是CSS的问题,而不是php代码或javascript.

Thx to @T30, I figured it out. Was apparently a problem with the CSS not anything with the php code or the javascript.

这篇关于getElementByID与document.reffer吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆