Loading...

Follow Reddit - JavaScript on Feedspot

Continue with Google
Continue with Facebook
or

Valid

Hi,

I am working on designing a SPA.

While using AngularJS or any other MVW framework is great for a SPA. I would like to know the advantages of using Jquery and Native Javascript since I am planning to support this website for IE as well.

Few of my current search on this area include

  1. Any SPA Data relies on storing data in localStorage which is considered in unreliable in IE. LocalStorage in itself is considered insecure
  2. WebWorkers are not well supported in IE/Edge. I have observed poor management in case of continuous creation and termination of web workers.
  3. Managing authentication tokens for partial page views in my scenario would be a difficult to handle. Any tips on this?
submitted by /u/codlocker
[visit reddit] [comments]
Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

Backstory:

My employer has a no framework (except for bootstrap) policy, because the effort they had to put on upgrading Ruby on Rails in the past, the lack of backwards compatibility really traumatized them.

We just use HTML/JS (also jQuery)/CSS, and that old php-html spaghetti (luckily php is not my job).

It's ok for building websites for business attached to a CMS, they are pretty small, and we've been only doing that in the past. The issue is that some customers want us to build their Intranets, and building without components is pretty frustrating, since there is a lot of repetition in these systems, and because we can't use frameworks, I started looking for alternatives.

Here are the options I've considered:

1 - Native Web Components

Seems cool but it's not very adopted yet, it even has scoped CSS. There is also cool MDN and Google guides. Internet people say that Shadow DOM is not IE friendly because it can't be polyfilled, but we don't support IE at my job.

2 - Polymer Web Components

Seems nice, don't really have an opinion.

3 - PHP Functions that returns HTML heredoc

Ugly HTML but nobody that makes decision will complain at my job, because they like PHP.

submitted by /u/Aewawa
[visit reddit] [comments]
Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

Hey everyone,

I'm having some trouble with converting a promise that uses objects into async / await code. I've written a bit of async code in Javascript before, but for whatever reason I can't seem to figure this one out. My apologies if this is a simple question.

https://pastebin.com/ingNXScE

submitted by /u/kevbr
[visit reddit] [comments]
Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

I have an issue where inside the function geo.find, the console.log('Inner Response') returns the proper data. However, when I assign response = response[0].location, the console.log('Outer Response') returns undefined. Is this an async/await issue or scope?

I've been trying to debug and try other solutions for hours, but I'm still getting the same issue. Can someone explain to me what is happening?

// Imports: Dependencies const firebase = require('firebase'); const geocoder = require('google-geocoder'); // Imports: Data (Array Of Objects) const originalData = require('../data/data'); // Reverse Geocode const reverseGeocode = async (array) => { try { // New Data let newData = []; // Geocoder let geo = geocoder({ key: 'API_KEY_HERE', }); // Iterate Over Original Data for (let i = 0; i < array.length; i++) { // Response let response = null; // Latitude/Longitude let latitude = null; let longitude = null; // Address Details let street = json[i].street; let city = json[i].city; let state = json[i].state; let zipCode = json[i].zip_code; let fullAddress = await street.concat(' ', city).concat(' ', state).concat(' ', zipCode); // Google Geocoding API await geo.find(fullAddress, async (error, response) => { // Check For Errors if (error) { console.log(error); } // Assign Response response = response[0].location; // Check Response (Inner) console.log('Inner Response'); console.log(response); }); // Check Response (Outer) console.log('Outer Response'); console.log(response) break; } } catch (error) { console.log(error); } } reverseGeocode(originalData); 
submitted by /u/Jeffylew77
[visit reddit] [comments]
Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

Are you the Javascript programmer?

Are you a competitive programmer? OR want to improve your algorithm and data structure skill by solving programming problems on websites like codechef, topcoder, hackerrank, hackerearth etc.

Then this post is for you :)

Summary:

I have developed an NPM module whose goal is to Help Javascript competitive programmers:

- To start writing code without any boilerplate code

- To debug the code easily by providing test cases through terminal one by one and check output right away.

Link: https://www.npmjs.com/package/competitive-programming-js

For more info read this LinkedIn article: https://www.linkedin.com/pulse/npm-package-javascriptnodejs-competitive-programmers-manish-menaria

submitted by /u/themanish003
[visit reddit] [comments]
Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

I bought my first phone 2 days ago! I've always shrugged off buying a phone because I tend to lose things quite easily, however I bought one recently after I felt curious about mobile development.

I've been writing web apps and desktop apps for quite some time using the lot like Electron, React, Express etc. etc. and recently after seeing the mobile app for my ISP I genuinely felt like writing my own.

So I took upon myself the liberty to hop in on reddit to ask my fellow developers who actually do mobile development with JS based technologies maybe professionally or just for the lulz, for recommendations of frameworks like Electron for mobiles, suggestions, tips and tricks, learning materials and literally anything that would help me write my own mobile app.

There is one more problem though, I did mention I bought my first phone which also means I don't know much about this whole Android vs IOS thing and also Native vs Hybrid topic, if there are any materials you could recommend me on understanding these topics better, I'd appreciate it very much!

I know I could google this type of thing easily and do the surfing myself, but I am fairly confused by the little research I did to get to know about the existence of Android, IOS, Native etc. etc. I mean I've heard about them before but never actually got to know it better.

Thank you for your effort!

EDIT: After I write my own mobile app, I will surely post it on reddit!

submitted by /u/Mydrax
[visit reddit] [comments]
Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

Did you find or create something cool this week in javascript?

Show us here!

submitted by /u/AutoModerator
[visit reddit] [comments]
Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 
Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

Read for later

Articles marked as Favorite are saved for later viewing.
close
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

Separate tags by commas
To access this feature, please upgrade your account.
Start your free month
Free Preview