Godlike Productions - Discussion Forum
Users Online Now: 2,065 (Who's On?)Visitors Today: 1,004,539
Pageviews Today: 1,798,145Threads Today: 774Posts Today: 13,738
08:22 PM


Rate this Thread

Absolute BS Crap Reasonable Nice Amazing
 

GLP Javascrip Helpdesk. How May we Help You? ((Can we write some Javascript/JQuery to stop the double posting on the submit button?))

 
Daozen
Offer Upgrade

User ID: 79239756
Taiwan
12/26/2020 08:50 PM
Report Abusive Post
Report Copyright Violation
GLP Javascrip Helpdesk. How May we Help You? ((Can we write some Javascript/JQuery to stop the double posting on the submit button?))
Three lines of JQuery, mods. We can help if you like.

$('form').submit(function(){
$('input[type=submit]', this).attr('disabled', 'disabled');
});


Disclaimer:

This only works when javascript is enabled on the user's browser. If the data that's being submitted is critical (like a credit card purchase), then consider my solution as only the first line of defense. For many use cases though, disabling the submit button will provide enough prevention.

I would implement this javascript-only solution first. Then track how many duplicate records are still getting created. If it's zero (or low enough to not care), then you're done. If it's too high for you, then implement a back-end database check for an existing record.


[link to stackoverflow.com (secure)]

hiding

[link to stackoverflow.com (secure)]

[link to stackoverflow.com (secure)]

Last Edited by Daozen on 01/08/2021 11:42 AM
Daozen appears to be mentally impaired, but harmless.

Attention! You are in a Private Universe. Simulation Terms of Service: h t t p s ://godlikemidnight . vercel . app

The world is a feeling.

"The syntactical nature of reality, the real secret of magic, is that the
world is made of words."
Anonymous Coward
User ID: 79509474
United States
12/26/2020 08:51 PM
Report Abusive Post
Report Copyright Violation
Re: GLP Javascrip Helpdesk. How May we Help You? ((Can we write some Javascript/JQuery to stop the double posting on the submit button?))
Very nice solution :)
Debug

User ID: 78876417
United States
12/26/2020 08:53 PM
Report Abusive Post
Report Copyright Violation
Re: GLP Javascrip Helpdesk. How May we Help You? ((Can we write some Javascript/JQuery to stop the double posting on the submit button?))
LMAO! jQuery.

I remember those days.
Daozen  (OP)

User ID: 79239756
Taiwan
12/26/2020 08:53 PM
Report Abusive Post
Report Copyright Violation
Re: GLP Javascrip Helpdesk. How May we Help You? ((Can we write some Javascript/JQuery to stop the double posting on the submit button?))
Very nice solution :)
 Quoting: Anonymous Coward 79509474


Just inspected element and saw they already have an old JQuery library as a dependency. Version 1.6.2, from 2011.

[link to blog.jquery.com (secure)]

I'm guessing that code'll slip right in.

Last Edited by Daozen on 12/26/2020 08:54 PM
Daozen appears to be mentally impaired, but harmless.

Attention! You are in a Private Universe. Simulation Terms of Service: h t t p s ://godlikemidnight . vercel . app

The world is a feeling.

"The syntactical nature of reality, the real secret of magic, is that the
world is made of words."
Anonymous Coward
User ID: 79509474
United States
12/26/2020 08:55 PM
Report Abusive Post
Report Copyright Violation
Re: GLP Javascrip Helpdesk. How May we Help You? ((Can we write some Javascript/JQuery to stop the double posting on the submit button?))
LMAO! jQuery.

I remember those days.
 Quoting: Debug


And what do you use smartass,?
Daozen  (OP)

User ID: 79239756
Taiwan
12/26/2020 08:55 PM
Report Abusive Post
Report Copyright Violation
Re: GLP Javascrip Helpdesk. How May we Help You? ((Can we write some Javascript/JQuery to stop the double posting on the submit button?))
LMAO! jQuery.

I remember those days.
 Quoting: Debug


It's still damn useful. Millions of fiddles out there. I use it here and there. It'll be around forever.

If you've got an elegant solution in hipster.js we're listening. :)

Last Edited by Daozen on 12/26/2020 09:03 PM
Daozen appears to be mentally impaired, but harmless.

Attention! You are in a Private Universe. Simulation Terms of Service: h t t p s ://godlikemidnight . vercel . app

The world is a feeling.

"The syntactical nature of reality, the real secret of magic, is that the
world is made of words."
Daozen  (OP)

User ID: 79239756
Taiwan
12/26/2020 08:58 PM
Report Abusive Post
Report Copyright Violation
Re: GLP Javascrip Helpdesk. How May we Help You? ((Can we write some Javascript/JQuery to stop the double posting on the submit button?))
LMAO! jQuery.

I remember those days.
 Quoting: Debug


And what do you use smartass,?
 Quoting: Anonymous Coward 79509474


Bro, Vue is F**kin DEAD. Can't stand it. We moved to Svelte.JS three months ago and never looked back. Productivity has soared.
Daozen appears to be mentally impaired, but harmless.

Attention! You are in a Private Universe. Simulation Terms of Service: h t t p s ://godlikemidnight . vercel . app

The world is a feeling.

"The syntactical nature of reality, the real secret of magic, is that the
world is made of words."
Half Past Midnight

User ID: 78659823
United States
12/26/2020 09:10 PM
Report Abusive Post
Report Copyright Violation
Re: GLP Javascrip Helpdesk. How May we Help You? ((Can we write some Javascript/JQuery to stop the double posting on the submit button?))
Very nice solution :)
 Quoting: Anonymous Coward 79509474


yeah
Daozen  (OP)

User ID: 79239756
Taiwan
12/26/2020 09:19 PM
Report Abusive Post
Report Copyright Violation
Re: GLP Javascrip Helpdesk. How May we Help You? ((Can we write some Javascript/JQuery to stop the double posting on the submit button?))
So how big is local RAM storage on the average phone? I want to load some news links on a Google sheet as a JSON object. This'll give me a volatile but ultrafast latest news database that the user can access at high speed. How big can a single JSON object loaded into RAM be, if I want to follow Android and iOS best practices? Could I get away with 100MB if I garbage collected alright? This is all new to me.

Last Edited by Daozen on 12/26/2020 09:22 PM
Daozen appears to be mentally impaired, but harmless.

Attention! You are in a Private Universe. Simulation Terms of Service: h t t p s ://godlikemidnight . vercel . app

The world is a feeling.

"The syntactical nature of reality, the real secret of magic, is that the
world is made of words."
Anonymous Coward
User ID: 73588932
United States
12/26/2020 09:22 PM
Report Abusive Post
Report Copyright Violation
Re: GLP Javascrip Helpdesk. How May we Help You? ((Can we write some Javascript/JQuery to stop the double posting on the submit button?))
So how big is local RAM storage on the average phone? I want to load a Google sheet as a JSON object. This'll give me a volatile but ultrafast latest news database that the user can access at high speed. How big can a single JSON object loaded into RAM be, if I want to follow Android and iOS best practices? Could I get away with 100MB if I garbage collected alright? This is all new to me.
 Quoting: Daozen


100MB,sounds like a real monster.ill bet it eats phones like candy.
Daozen  (OP)

User ID: 79239756
Taiwan
12/26/2020 09:27 PM
Report Abusive Post
Report Copyright Violation
Re: GLP Javascrip Helpdesk. How May we Help You? ((Can we write some Javascript/JQuery to stop the double posting on the submit button?))
So how big is local RAM storage on the average phone? I want to load a Google sheet as a JSON object. This'll give me a volatile but ultrafast latest news database that the user can access at high speed. How big can a single JSON object loaded into RAM be, if I want to follow Android and iOS best practices? Could I get away with 100MB if I garbage collected alright? This is all new to me.
 Quoting: Daozen


100MB,sounds like a real monster.ill bet it eats phones like candy.
 Quoting: Anonymous Coward 73588932


I dunno if you're being sarcastic or not. I don't want to be a jerk and use too much RAM. I don't use mobiles, so I know nothing about them. I know phones are getting more powerful every year.

Look at what I'm doing here. Articles load lightning fast, as soon as the user starts typing.

[link to kalki.surge.sh (secure)]

My web-app works better on desktop. I'm learning to scrape now. I can make the RAM DB as small as 30MB, or go up to 1GB. It all depends on current memory allocation limits. I can research it, but wondered if anyone more experienced had any ideas.

I guess on desktops I have much more freedom.
Daozen appears to be mentally impaired, but harmless.

Attention! You are in a Private Universe. Simulation Terms of Service: h t t p s ://godlikemidnight . vercel . app

The world is a feeling.

"The syntactical nature of reality, the real secret of magic, is that the
world is made of words."
Anonymous Coward
User ID: 73588932
United States
12/26/2020 09:35 PM
Report Abusive Post
Report Copyright Violation
Re: GLP Javascrip Helpdesk. How May we Help You? ((Can we write some Javascript/JQuery to stop the double posting on the submit button?))
shoot for as little as neccessary while keeping speed as fast as possible.a small ram means faster request.
at 50mb apk size,most smart phones start seeing performance issues and the heavy load of stored bloatware isnt dumped fast enough.
cookies etc,eating up bandwidth,pennies at a time.
when building anything,lite is rite.dump old files as soon as process ends.

small files operating that are hacked will see performance issues immediately,big files do not.

thats why i like superlite browsers,sure they are easy to backdoor but i also notice the moment that backdoor is opened.
Daozen  (OP)

User ID: 79239756
Taiwan
12/26/2020 09:41 PM
Report Abusive Post
Report Copyright Violation
Re: GLP Javascrip Helpdesk. How May we Help You? ((Can we write some Javascript/JQuery to stop the double posting on the submit button?))
shoot for as little as neccessary while keeping speed as fast as possible.a small ram means faster request.
at 50mb apk size,most smart phones start seeing performance issues and the heavy load of stored bloatware isnt dumped fast enough.
cookies etc,eating up bandwidth,pennies at a time.
when building anything,lite is rite.dump old files as soon as process ends.

small files operating that are hacked will see performance issues immediately,big files do not.

thats why i like superlite browsers,sure they are easy to backdoor but i also notice the moment that backdoor is opened.
 Quoting: Anonymous Coward 73588932


That's good advice, cheers. I agree lite + minimal is popular. I'm going to have

- no tracking
- minimal to no cookies
- Very few photos.

I'm keeping it text only. I realized I can index just the url/title, and 2 short paragraphs from each article in the RAM database.

I dunno, I tested it on a couple of ladies, and they thought the offline browsing was cool. Google is a RAM hog cos of all the spying they do. That's now well known.

I figure if I can keep 1000 breaking news/general interest articles stored in a JSON object that instantly loads, users are gonna be intrigued, liberated and happy. Then I can figure out service workers and update 2-4 times a day. Users will have a breaking news database on their phone, even with no signal.

Cheers. Hope you stick around.

Last Edited by Daozen on 12/26/2020 09:55 PM
Daozen appears to be mentally impaired, but harmless.

Attention! You are in a Private Universe. Simulation Terms of Service: h t t p s ://godlikemidnight . vercel . app

The world is a feeling.

"The syntactical nature of reality, the real secret of magic, is that the
world is made of words."
Debug

User ID: 78876417
United States
12/27/2020 12:49 AM
Report Abusive Post
Report Copyright Violation
Re: GLP Javascrip Helpdesk. How May we Help You? ((Can we write some Javascript/JQuery to stop the double posting on the submit button?))
LMAO! jQuery.

I remember those days.
 Quoting: Debug


And what do you use smartass,?
 Quoting: Anonymous Coward 79509474


Angular, React, Vue. You know, real front end frameworks.
Debug

User ID: 78876417
United States
12/27/2020 12:51 AM
Report Abusive Post
Report Copyright Violation
Re: GLP Javascrip Helpdesk. How May we Help You? ((Can we write some Javascript/JQuery to stop the double posting on the submit button?))
Angular with NgRx for a very large enterprise front end has been great for us. Productivity is off the charts.

React was alright and vue.js was as well, but Angular takes a lot of the arguing out of it for you and let's you just get a lot of shit done.
Anonymous Coward
User ID: 78860232
Latvia
12/27/2020 12:52 AM
Report Abusive Post
Report Copyright Violation
Re: GLP Javascrip Helpdesk. How May we Help You? ((Can we write some Javascript/JQuery to stop the double posting on the submit button?))
LMAO! jQuery.

I remember those days.
 Quoting: Debug


When we could actually control a page. Now we navigate frameworks.
Anonymous Coward
User ID: 75484990
United States
12/27/2020 01:00 AM
Report Abusive Post
Report Copyright Violation
Re: GLP Javascrip Helpdesk. How May we Help You? ((Can we write some Javascript/JQuery to stop the double posting on the submit button?))
LMAO! jQuery.

I remember those days.
 Quoting: Debug


And what do you use smartass,?
 Quoting: Anonymous Coward 79509474


Angular, React, Vue. You know, real front end frameworks.
 Quoting: Debug

Nothing beats core knowledge, package boy.

Don't niche your way out of the market.
Anonymous Coward
User ID: 77506652
Netherlands
12/27/2020 01:09 AM
Report Abusive Post
Report Copyright Violation
Re: GLP Javascrip Helpdesk. How May we Help You? ((Can we write some Javascript/JQuery to stop the double posting on the submit button?))
Will it remove the - the the and the and and?
Anonymous Coward
User ID: 77506652
Netherlands
12/27/2020 01:11 AM
Report Abusive Post
Report Copyright Violation
Re: GLP Javascrip Helpdesk. How May we Help You? ((Can we write some Javascript/JQuery to stop the double posting on the submit button?))
Three lines of JQuery, mods. We can help if you like.

$('form').submit(function(){
$('input[type=submit]', this).attr('disabled', 'disabled');
});


Disclaimer:

This only works when javascript is enabled on the user's browser. If the data that's being submitted is critical (like a credit card purchase), then consider my solution as only the first line of defense. For many use cases though, disabling the submit button will provide enough prevention.

I would implement this javascript-only solution first. Then track how many duplicate records are still getting created. If it's zero (or low enough to not care), then you're done. If it's too high for you, then implement a back-end database check for an existing record.


[link to stackoverflow.com (secure)]

hiding

[link to stackoverflow.com (secure)]

[link to stackoverflow.com (secure)]
 Quoting: Daozen

also, please make a 4chan and glp that is not controlled like the gestappo headquarters
Anonymous Coward
User ID: 77506652
Netherlands
12/27/2020 01:12 AM
Report Abusive Post
Report Copyright Violation
Re: GLP Javascrip Helpdesk. How May we Help You? ((Can we write some Javascript/JQuery to stop the double posting on the submit button?))
let me guess OP is now banned

hiding
Anonymous Coward
User ID: 20320183
United States
12/27/2020 01:15 AM
Report Abusive Post
Report Copyright Violation
Re: GLP Javascrip Helpdesk. How May we Help You? ((Can we write some Javascript/JQuery to stop the double posting on the submit button?))
if hes building a newsboard,forget it.its all from same pit of shit and the boards just brand it and shuffle it.

aps that give back control of a smartphone without rooting is the pinnacle of godhood in programming.you break google,the world is your oyster.
you provide real blockage of keystroke views and real encrypted data on blockchain that runs a voice and picture mode.
then run this through blutooth bump as the only way to join the blockchain.
all while blocking all 2g and 911 backdoor hacks,you got a solid apk.
if you are really evil,you put in a man in the middle catcher that runs a background check and gps on the thug.
Daozen  (OP)

User ID: 79239756
Taiwan
01/08/2021 11:43 AM
Report Abusive Post
Report Copyright Violation
Re: GLP Javascrip Helpdesk. How May we Help You? ((Can we write some Javascript/JQuery to stop the double posting on the submit button?))
let me guess OP is now banned

hiding
 Quoting: Anonymous Coward 77506652


Nope. OP is here, resting before work tomorrow. The news app is getting built slowly. Should be able to demo it within a coupla weeks.
Daozen appears to be mentally impaired, but harmless.

Attention! You are in a Private Universe. Simulation Terms of Service: h t t p s ://godlikemidnight . vercel . app

The world is a feeling.

"The syntactical nature of reality, the real secret of magic, is that the
world is made of words."
Anonymous Coward
User ID: 76693939
United States
01/08/2021 11:45 AM
Report Abusive Post
Report Copyright Violation
Re: GLP Javascrip Helpdesk. How May we Help You? ((Can we write some Javascript/JQuery to stop the double posting on the submit button?))
Good idea.
Anonymous Coward
User ID: 76693939
United States
01/08/2021 11:45 AM
Report Abusive Post
Report Copyright Violation
Re: GLP Javascrip Helpdesk. How May we Help You? ((Can we write some Javascript/JQuery to stop the double posting on the submit button?))
Good idea.
Anonymous Coward
User ID: 76693939
United States
01/08/2021 11:45 AM
Report Abusive Post
Report Copyright Violation
Re: GLP Javascrip Helpdesk. How May we Help You? ((Can we write some Javascript/JQuery to stop the double posting on the submit button?))
Good idea.
Daozen  (OP)

User ID: 79239756
Taiwan
01/08/2021 11:46 AM
Report Abusive Post
Report Copyright Violation
Re: GLP Javascrip Helpdesk. How May we Help You? ((Can we write some Javascript/JQuery to stop the double posting on the submit button?))
if hes building a newsboard,forget it.its all from same pit of shit and the boards just brand it and shuffle it.

aps that give back control of a smartphone without rooting is the pinnacle of godhood in programming.you break google,the world is your oyster.
you provide real blockage of keystroke views and real encrypted data on blockchain that runs a voice and picture mode.
then run this through blutooth bump as the only way to join the blockchain.
all while blocking all 2g and 911 backdoor hacks,you got a solid apk.
if you are really evil,you put in a man in the middle catcher that runs a background check and gps on the thug.
 Quoting: Anonymous Coward 20320183


I'll remember the technical advice longterm, cheers mang. You've got a good point about all news apps just recycling the same news. On the advice of a couple of people here, Im going to de-emphasize breaking news.

Peace.
Daozen appears to be mentally impaired, but harmless.

Attention! You are in a Private Universe. Simulation Terms of Service: h t t p s ://godlikemidnight . vercel . app

The world is a feeling.

"The syntactical nature of reality, the real secret of magic, is that the
world is made of words."
Daozen  (OP)

User ID: 79239756
Taiwan
01/08/2021 11:48 AM
Report Abusive Post
Report Copyright Violation
Re: GLP Javascrip Helpdesk. How May we Help You? ((Can we write some Javascript/JQuery to stop the double posting on the submit button?))
Good idea.
 Quoting: Anonymous Coward 76693939


That was a triple post, you're in the clear.
Daozen appears to be mentally impaired, but harmless.

Attention! You are in a Private Universe. Simulation Terms of Service: h t t p s ://godlikemidnight . vercel . app

The world is a feeling.

"The syntactical nature of reality, the real secret of magic, is that the
world is made of words."
Daozen  (OP)

User ID: 79239756
Taiwan
01/08/2021 11:49 AM
Report Abusive Post
Report Copyright Violation
Re: GLP Javascrip Helpdesk. How May we Help You? ((Can we write some Javascript/JQuery to stop the double posting on the submit button?))
also, please make a 4chan and glp that is not controlled like the gestappo headquarters
 Quoting: Anonymous Coward 77506652


Making a 4chan would take a lot of work, and a little cash. But it's doable long term. Long term meaning 2-3 years.
Daozen appears to be mentally impaired, but harmless.

Attention! You are in a Private Universe. Simulation Terms of Service: h t t p s ://godlikemidnight . vercel . app

The world is a feeling.

"The syntactical nature of reality, the real secret of magic, is that the
world is made of words."
Daozen  (OP)

User ID: 79239756
Taiwan
01/08/2021 11:54 AM
Report Abusive Post
Report Copyright Violation
Re: GLP Javascrip Helpdesk. How May we Help You? ((Can we write some Javascript/JQuery to stop the double posting on the submit button?))
Chris Coyier saves the universe yet again:

[link to css-tricks.com (secure)]
Daozen appears to be mentally impaired, but harmless.

Attention! You are in a Private Universe. Simulation Terms of Service: h t t p s ://godlikemidnight . vercel . app

The world is a feeling.

"The syntactical nature of reality, the real secret of magic, is that the
world is made of words."
Daozen  (OP)

User ID: 79239756
Taiwan
01/08/2021 11:54 AM
Report Abusive Post
Report Copyright Violation
Re: GLP Javascrip Helpdesk. How May we Help You? ((Can we write some Javascript/JQuery to stop the double posting on the submit button?))
Chris Coyier saves the universe yet again:

[link to css-tricks.com (secure)]
Daozen appears to be mentally impaired, but harmless.

Attention! You are in a Private Universe. Simulation Terms of Service: h t t p s ://godlikemidnight . vercel . app

The world is a feeling.

"The syntactical nature of reality, the real secret of magic, is that the
world is made of words."
Daozen  (OP)

User ID: 80047120
Taiwan
03/07/2021 01:00 PM
Report Abusive Post
Report Copyright Violation
Re: GLP Javascrip Helpdesk. How May we Help You? ((Can we write some Javascript/JQuery to stop the double posting on the submit button?))
Why isn't this Vue router working? hnnng.

[link to codepen.io (secure)]

Original here:

[link to codepen.io (secure)]
Daozen appears to be mentally impaired, but harmless.

Attention! You are in a Private Universe. Simulation Terms of Service: h t t p s ://godlikemidnight . vercel . app

The world is a feeling.

"The syntactical nature of reality, the real secret of magic, is that the
world is made of words."





GLP