oh it is doing nothing with it… could you help on how to open it?
You need to decide what you want to have happen in the client. Not only are you not doing anything with the response, but you’re also loading a page.
If you want to actually go to that page, you probably don’t want to return the page itself - you’d be better off returning the url for the page as your response. Then, you can have your JavaScript go to that URL.
ohh… i am a bit confused. what do you mean by returning the URL as my response? how is it returning URL different from returning the page itself? won’t the URL have the page?
A URL is a string, that when issued as a request to a server running Django, causes a view to execute.
A page is an HTML document.
OoO how do i execute that though? is it with JsonResonponse code?
Execute what?
Yes, your view could return a JsonResponse.
like how do i return URL as my response and make my javascript go to the URL? I’m sorry about all the noob questions
The full details of that are far beyond what can be reasonably covered in a forum post. It also depends upon what JavaScript framework you may be using. I suggest you find an appropriate JavaScript tutorial that covers this.
oh… ok will try to look up on that! will it be a lot of details if i just want to return the page itself?
What I have most gathered from this conversation is that there are a number of fundamental topics you don’t appear to be comfortable with. That’s why I’m encouraging you to find some detailed JavaScript tutorials to help fill in those gaps.
ok thank you mr whitesell for all your help. hope you have a nice day ahead.