谷歌Chrome登录表单上的断点工作,但没有断点它不起作用 [英] with breakpoint on google chrome login form works ,but without breakpoint it don't work

查看:243
本文介绍了谷歌Chrome登录表单上的断点工作,但没有断点它不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



因为我是jquery和php的新手,我被困在1点,



我在html中有一个带有emailid和密码的登录表单。我写了一个webservice,如果用户成功登录然后显示home.html页面,则显示login.html页面。



一切正常,即php中的webservice是工作正常。当我检查使用谷歌chromes断点和F10然后结果显示正确,即如果用户是abc@gmail.com和密码是abc然后它给我home.html页面但这只发生在我使用谷歌chromes断点,然后只有它显示了我正确的结果,但它尝试直接运行没有任何断点然后它显示我的错误与空白消息。



你对我在哪里有任何建议吗?出错了。



Hi All,

As i am new to jquery and php, I was stuck at 1 point,

I have a login form with emailid and password in html. and i have written a webservice,if user logs in successfully then show home.html page else show login.html page.

Everything is working fine i.e. webservice in php is working fine. When i check using google chromes breakpoint and F10 then the result is showing correctly i.e. if user is abc@gmail.com and password is abc then it gives me the home.html page but this happens only when i use google chromes breakpoint,then only it shows me the correct result but it i try to run directly without any breakpoint then it shows me error with blank message.

Do you have any suggession on where i am going wrong.

$('#form').submit(function()    
    {
        var emailid = null;
        var password = null;
        var userData=null;

        emailid= $('#emailid').val();
        password= $('#password').val();

        userData='emailid='+ emailid +'password='+ password;
        alert(userData);
        if(emailid && password)
        {            
            Authenticate_User(userData);
        }
        else
        {
            alert('Email id and password cannot be blank');
        }
    });

function Authenticate_User(userData)
	{
		$.ajax({
			url: 'services/Login.php', 
			type: 'POST',
			data: userData,						
			contentType: 'application/x-www-form-urlencoded',
			dataType: "json",
			processData: false,
			 success: function(XMLHttpRequest,textStatus,errorThrown)
					{
						alert('Success is here');
						console.log('Success is here' + JSON.stringify(XMLHttpRequest.responseText));						
						window.location.href = "home.html";
						
					},
			 error: function(XMLHttpRequest,textStatus,errorThrown)
					{
						console.log('ERROR: ' + JSON.stringify(XMLHttpRequest.responseText));
						alert(JSON.stringify(XMLHttpRequest.responseText));						
					} 		 
		}).done(function(data) { console.log(data); })
    .fail(function() { alert("error"); })
    .always(function() { alert("complete"); });
	}

推荐答案

' #form')。submit( function ()
{
var emailid = null ;
var password = null ;
var userData = null ;

emailid =
('#form').submit(function() { var emailid = null; var password = null; var userData=null; emailid=


' #emailid')。val();
password =
('#emailid').val(); password=


' #password')。val();

userData = ' emailid =' + emailid + ' password =' +密码;
alert(userData);
if (emailid&& password)
{
Authenticate_User(userData);
}
其他
{
alert(' 电子邮件ID和密码不能为空);
}
});

function Authenticate_User(userData)
{
('#password').val(); userData='emailid='+ emailid +'password='+ password; alert(userData); if(emailid && password) { Authenticate_User(userData); } else { alert('Email id and password cannot be blank'); } }); function Authenticate_User(userData) {


这篇关于谷歌Chrome登录表单上的断点工作,但没有断点它不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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