Exchange Html Data form in Real Time [closed] - javascript

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 6 years ago.
Improve this question
hey guys I'm totally new to programing and I need your help to walk me through this .
lets say we have 2 users that want to communicate through HTML forms
The first users fills out a html form ( first name , last name , age etc ... ) and submits it .
The second user receives the form without being able to apply any modifications to it and then submits back to the first user as either approved or disapproved ( by ticking a radio button )
all of this has to happen in Real Time.
can somebody please explain to me how it works ? Is it done with Ajax ?
what should i research ?

You should look into Web Sockets, this is how you can accomplish the functionality you would like. Here is a link to some information on web sockets and it has a few different libraries that implement and abstract web socket to make it easier to use:
https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API
If you develop in Visual Studio with .NET, then you can check out Microsoft's SignalR library. It makes WebSocket coding easy:
http://www.asp.net/signalr
If you are wanting to stay away from WebSockets completely, then you would be looking to use AJAX and "Long Polling". here is a good SO post on this:
how does long polling work javascript?

Related

Button that updates number on all sessions [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I've tried a lot of ways, like for example the fs module, but I just can't find out how to implement this. I need a button that:
Updates by one whenever any user presses the button
Persists on the server
Does anyone know how to do this?
If you are new and need to build something that stores stuff on the server you have a lot to learn. If you just need to solve this simple problem and get things working you could make huge progress using a hosted backend service. If you do this you can write a couple of lines in JS and the job will be done. Most offer a free account.
One such service is built.io see link below:
https://docs.built.io/api-reference
var project = Built.App('blt5d4sample2633b').Class('score').Object();
project = project.increment('points',10); //Increases points field value by 10
That code above would update the score by 10 and store it , you can then retreive it when you show the page. All users would see the score update.
There are realtime backend services too which are very good.
An example is:
www.firebase.com
You would need to decide which one is best for you, add their script to your page add a button, hook the click event upto a function that you would then add the simple code to update the score. See above.
It a nutshell that would be it. You can probably get it working in under 1 hour if you follow the guides on the vendors site.
Firebase is backed by google and has a huge online community.

Browsing a database as the user is typing [closed]

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
This is probably a simple question, but I'm struggling with this.
Basically, how to browse in a database, as the user is typing something?
For example, in a website such as https://www.doesthedogdie.com/, how do they do it to show all the movies beggining with the string of characters you're typing, as you're typing it?
I guess javascript is involved?
It's called autocomplete
Please do some googling next time yourself.
You can use jQuery autocomplete or Bootstrap typeahead to achieve this.
Hope this helps
My personal preference on how to make these kind of systems is fairly awkward, yet it seems to work just fine for me without requiring too much client-side scripting.I use ASP.NET's Page_Load event to save all content in a SQL database into an XML file. Then, when the user enters some text into the field, I make a hidden div class underneath it unhidden to display filtered results from the XML document. This way, you can update the SQL database at any time fairly simply to add new records which should be listed on the website.This is server-side scripting, which I prefer to client-side because the user can disable features and mess around with it to view your code which is something I personally hate.I hope this helps you somewhat.

AJAX Microgames [closed]

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 8 years ago.
Improve this question
If you're not familiar with the concept of a Microgame, check out this video of WarioWare Twisted.
I'm interested in setting up a site where users can play series of browser-based Microgames which are delivered to them by a server. Ideally this would allow me to crowdsource the games and have an open submission system. What sort of scheme could I use to make this work?
I'm thinking that one way to do it would be to have each game consist of:
A javascript file that defines a MicroGame object that controls a rectangular portion of the screen, gets input and timing information from the main page, then calls back to the main page with a "Success" or "Failure" message.
A folder of assets that must be downloaded before the game executes.
Is this possible to do, client-side within a browser? Where would be a good place to start figuring this out?
There are a lot of open issues here. The biggest problem is what language do they submit games in which you can execute safely on the players machines? That said, there are tools like this out there. You could look at the excellent Play My Code for inspiration.

Classroom assessment tool [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I want to create an HTML file which pulls information from one of several possible databases.
The database will consist of students names and target grades and there will be one for each class.
The page created will effectively have a block/button for each student with a drop down box which contains a grade.
I would like to send this data to another database (one for each class) to track progress over time, effectively when submitting the classes grades I want to add a coloumn to the database
I have been learning programming for the last 12 months and have a reasonable understanding of HTML, JavaScript, Python (I have also just started leanring some jquery) . I dont want a full fledged solution but if someone could point me in the right direction I would be happy to do the hard work.
Primary question is what language do I need to learn to code read and write to the database? Any other suggestions about scripting are more than welcome.
I would use PHP and Javascript (jQuery is a easy to use framework). PHP can handle the "backend" operations like reading and writing to the database. HTML / CSS / Javascript can handle the view.
If you want to do all of this without the annoying page refreshes you can take a look at AJAX.
Some links to help you getting started
http://www.php.net/manual/en/getting-started.php
http://learn.jquery.com/javascript-101/getting-started/

How to make a password that unlocks with buttons clicked in a specific order [closed]

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 8 years ago.
Improve this question
I've recently created a few piano keys using HTML, CSS and some Javascript and I would like to know how to go about creating a password that only unlocks when certain keys are played in a specific order.
I imagine the code would go something like:
if (correct sequence of keys are input) {
unlocks secret content;
}else{
message: try again!;
}
I've never made a password lock of any kind and I'm not sure what language would be idea for a password... Ideally it would word in browsers and on phones. I'm really new to javascript and I know that people can easily see your code so I guess I can't really use that because people would look for the password. Any ideas/guidance would be greatly appreciated!
If you don't want users to see the login credentials, you'll need to include some server side code with PHP, or ASP.NET for example so that the check is done on the server and not in the users browser.
But otherwise it would be fairly simple to do this piano key check by making each click on the buttons add a new character to a string.
var pw="";
document.getElementById('key1').onclick=function(){pw +="x"};
And then just do a standard check on that string to a saved password.

Categories