Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 74735

how send server data in a multi page web application?

$
0
0

In these days i made a standart home page, a login page and a user information page. In my login page using method POST and Ajax(Fetch), i send the e-mail and password to the server, the server responses the correct json with the user information that belongs to that e-mail. BUT i dont have idea how that user information in JSON can use in another html document like a user information page. I try so many things but nothing

form.addEventListener('submit',(e)=>{

e.preventDefault();

    const data={}

    data1.correo=email.value;
    data1.contrasenia=password.value;


        const miinit={
        method:'POST',                    
        headers: {"Content-type":"application/json"},
        body:JSON.stringify(data1)}

        const url='https://localhost:44351/api/login';

        const myrequest =new Request(url,miinit)

    const requestpost=()=>{

        fetch(myrequest).then(response=>{console.log(response);return response.json()}).then(response=>{console.log(response)})
    }    

    requestpost()
})

I'm junior developer


Viewing all articles
Browse latest Browse all 74735

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>