Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
So I'm trying to create a JavaScript code for a button that allows me to login to a website that I have created. I have my database that the information will be retrieving the verification from. I just can't seem to get the functionality to the button to do such a thing. So far all I have done was trying to reverse engineer the Facebook code login button but yet all I had on my hands after that was a big mess. I know I'm a bit over my head in this situation. JavaScript isn't my best language. I have a button right now and that's it.
This is not a JavaScript question but a design question.
You are dealing with three levels here. In brief -
View - Your html (button), css & JS
Controller - Your space for action, validation and logic
Data - Your data stored in your DB
You've got the view (partially) and the Data layers figured out; however, you haven't worked on your controller layer.
Your controller layer should consume the data from the view (login details), validate the data, transform (if necessary) and authenticate against the DB.
You can build your controller on the server (Java, nodeJS, etc.) or on the client (JavaScript AJAX).
Hence, I suggest you figure out where do you want your code to live - on your server or in the browser. You should also keep in mind security.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed last year.
Improve this question
I am just entered this game since last December. Now I finished HTML CSS and a little bit of Java Script yet I got stuck at this stage: I can do basic styling but I don't know how to make it interactive.
So my question is :
how can I make a login function for websites, which can gives visitor an account (sign up, login, forgot password) that can do basic things like comment , add to basket and favorite a product?
Don't need to be specific, please just highlight which language is involved in which stage.
Thanks ahead.
Now I finished HTML CSS and a little bit of Java Script
So your site is what is called a static website.
If you want to allow login and data storing, you need a dynamic website, that requires one of this technologies:
PHP
ASP (check also ASP.NET)
Node.js (with express or http module)
Django (Python's library)
A few others...
All this technologies are called server-side languages/technologies, and the most used for long years has been PHP, that now has some strong rivals in terms of usage.
You can use only html/js to create a website. But, if you need authentication, post comments, a server side is needed.
A js can call easely an API to authenticate (server side) and post comments with XHR. You have to create it. You need to know how Authentication headers works for server side. You need to have a database (sql, file or nosql, it's your choice) to save the users datas and rights.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I'm working on a fairly ambitious project for me. There is a complete tutorial that describes how to create an environment on the web site (a kind of user panel) where registered users can upload files, audio, video etc .. edit the name, create folders, and share it with other users. Manage their information, update or modify them. Create folders with random names when loading files on the server. The graphics look I can create, but interaction with the database to retrieve the information of each user and show them in the panel I can not do it without having the necessary knowledge. Every advice, guide and tutorials is well accepted. (Forgive my dingy English)
Node.js is server-side. You need to work with modules for what you want to do. For example: express to easily work with GET, POST data; and other modules you can find on NPM.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm building an app in django that lets users create and edit flowcharts for the purpose of process/procedure control. There are three basic models: Procedure, Step, and Transition.
I've created and debugged all the model relationships and through the admin interface and shell, I can create Procedures with several Steps and Transitions. It's functional but not intended for the end user. I need to create a browser-based jgraphical interface.
Enter visjs, a javascript visualization library. Using visjs, I've created a basic block-diagram editor that lets users add/edit/delete nodes and edges (this is my first javascript attempt ever). I can load data from the database and post data back to the database through a couple of custom views and JSON serialization. However, it feels kludgey and hard to maintain. For example, it's not integrated into django's forms framework at all.
At the moment, when submitted, the javascript does the serialization to post JSON data and JSON data only. I'd really like this to be a standard form submission but I can't figure out how to structure the form.
How would you go about building a form to do handle this? I'm basically trying to get my javascript block diagram to be the form, if that makes any sense. Is this the use-case for a custom widget?
Another wrinkle here is that the editor needs to create/update/delete the top-level procedure, the steps, and the edges.
Thanks for your help
I think a custom widget is what your looking for and would start by learning from examples of other Django apps which do something similar. The project I am currently working on includes the app named django-ckeditor which creates a widget around ckeditor. I believe it solves a similar problem to yours in the sense that it creates a Django widget from a javascript widget.
Study how they approach a similar problem and see if it helps.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 8 years ago.
Improve this question
I'm trying to get help with this question and consequently build my website www.videocontractor.com. I've posed this question and solicited bids on the requisite code on freelancer.com. People on there have told me that it is indeed possible for a third party to fill out a php form on my site and in turn update the java code in my index file. I'm not sure I believe them. From the project description:
I'm looking to add a module on www.videocontractor.com and www.photocontractor.com that will enable visitors to the sites to add their business listing. I'm not sure if this can be done. I'm would like the javascript in the index.html file to be updated by site visitors. I think a PHP solution is needed. I'm open to other ideas.
Can someone on here tell me yes or no if I can add the functionality that has been somewhat described above? Are there any alternatives I should look into that would provide me with the same end result.
https://www.freelancer.com/projects/PHP-Javascript/PHP-Java-for-business-directory.html
From your description, you have asked someone to write code that modifies files on disk. While it is possible to do this in a safe way, I recommend against it.
What I recommend you do instead is keep your entries in a database, and generate resources dynamically, upon request. Be sure to use prepared/parameterized queries (PDO has this capability), and any data you output in the context of HTML use htmlspecialchars(). If you are outputting data into JavaScript, use json_encode(). This will ensure that the data remains just that... data, and not possible code for execution.
It all depends on what you are doing later with that form. If you are putting it straight inside a query to a database without cleaning it, then it is completely possible to change your website. They can also use MySQL injections that way, and you could possibly loose your entire database.
If you want to filter what they write in the form, you can use strip_tags and after that addslashes, which will completely prevent any possible damage.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I am attempting to build a tool for use at my work that compares some very simple data. All of the data is available through the eBay trading API via the GetItem call. In the Trading API guide from the eBay Developer website the sample input and output code to make the GetItem call is shown in XML. However I'm still confused on how to write something in HTML/Javascript that makes the call and then displays the data from the call I need. I have experience with HTML and have read through the CSS, Javascript, and XML guides on W3schools.com but don't know how to put together what I've learned to accomplish this end. Is there something in addition to what I've read that can help me understand how to accomplish this goal? Or suggestions on the code itself?
Help would greatly be appreciated as this tool will be used (if I can get it to work) by my whole department here at eBay Customer Support.
First of all you need to get registered with the eBay's developer program from its official website. You can get more support and documentation from there. It would be more helpful if you told us which language you are working with. As the API calls need to be made any specific language and not just HTML/Javascript. Here is a sample code that i came across on the official developer site of eBay. It is written in Perl but you can get the idea of the flow of programming and then can covert it in any language of your choice.
I hope it helps or at least gets you started in the right direction.