Jump to content

I would like some feedback on my project :)

Hi,

I was bored and was wondering if it's possible to build a website with one index file and javascript.

 

When I showed this to my friend he said that it's cool and he will try it, because of that I bought a domain and start working more... much more on it.

I'm working on it since a week or two. Whole day after I come from the work.

 

I was "creating" elements with the use of "innerHTML" but this has few flaws, so after some research, I found out how to create nodes and mastered it(?).

 

I'm working now on a function that will highlight all the code syntax (don't look in the console :d).

 

Web -> https://frontendjs.org

Repo -> https://github.com/damiantoczek/frontendjs.org

 

My code could be cleaner but yeah ?

AMD FX8320 | GTX660 | 4x4GB DDR3 | LG ZR2740W

Logitech Wireless Pro  | Logitech G413 | Nuforce uDAC5  | AKG K612

Link to comment
https://linustechtips.com/topic/1038464-i-would-like-some-feedback-on-my-project/
Share on other sites

Link to post
Share on other sites

Isn't that how single page applications work?

Ryzen 5 1600 @ 3.9 Ghz  | Gigabyte AB350M Gaming 3 |  PaliT GTX 1050Ti  |  8gb Kingston HyperX Fury @ 2933 Mhz  |  Corsair CX550m  |  1 TB WD Blue HDD


Inside some old case I found lying around.

 

Link to post
Share on other sites

There's soooooo many things that do this.  Not saying dont do it, hell no its a fantastic exercise and I learnt alot making a thingy like this once.  But just saying. 

Every time you see JSX it gets converted to something like this and many other things have this approach minus the jsx. 

One great example to look at is Mithril.....

https://mithril.js.org/#hello-world

...I picked Mithril because its great and most its docs show the none JSX versions but there is a jsx transpiler if you want to look at it.

Link to post
Share on other sites

3 hours ago, PAEz said:

There's soooooo many things that do this.  Not saying dont do it, hell no its a fantastic exercise and I learnt alot making a thingy like this once.  But just saying. 

Every time you see JSX it gets converted to something like this and many other things have this approach minus the jsx. 

One great example to look at is Mithril.....

https://mithril.js.org/#hello-world

...I picked Mithril because its great and most its docs show the none JSX versions but there is a jsx transpiler if you want to look at it.

Didn't see that, pretty cool! But I like mine more :D
m(root, "bla"); doesn't feel the same to me.

 

6 hours ago, bleedblue said:

Isn't that how single page applications work?

Single page websites are written in HTML but not fully in Javascript.

AMD FX8320 | GTX660 | 4x4GB DDR3 | LG ZR2740W

Logitech Wireless Pro  | Logitech G413 | Nuforce uDAC5  | AKG K612

Link to post
Share on other sites

this looks very similar to what's already build into jquery where you can just do append/appendTo. Nice exercise i suppose but when you have to choose between this and something like jquery, which can do much much more, the choice is pretty easy ;).

I have no signature

Link to post
Share on other sites

On 2/28/2019 at 3:28 PM, Helly said:

this looks very similar to what's already build into jquery where you can just do append/appendTo. Nice exercise i suppose but when you have to choose between this and something like jquery, which can do much much more, the choice is pretty easy ;).

Yep, we will see in 1 year.

AMD FX8320 | GTX660 | 4x4GB DDR3 | LG ZR2740W

Logitech Wireless Pro  | Logitech G413 | Nuforce uDAC5  | AKG K612

Link to post
Share on other sites

9 minutes ago, DrTesla said:

Interesting idea, but I think just simply writing HTML would be easier.

Depends on you what you like, you can clearly see where is what, in HTML you have all that nested things and then you end up somewhere with 50 nested elements and you are searching and searching...

 

In my code you can see what the parent is at the start...
You can either init it at start and then add (that will make the load smoother) or you add elements first and then init it.
Init means adding the whole element somewhere. So to add it somewhere else, you don't need to look for the start and ending element etc, you just change the init. Everyone likes something else, I'm doing it mainly for my needs and for fun. If someone likes it, use it ^.^

AMD FX8320 | GTX660 | 4x4GB DDR3 | LG ZR2740W

Logitech Wireless Pro  | Logitech G413 | Nuforce uDAC5  | AKG K612

Link to post
Share on other sites

58 minutes ago, DrTesla said:

I don't think I'd personally use it, since I'm a software engineer not a web developer, but I think the concept would really appeal to some people, such as web developers, for example.

If it's well commented it should be fine to use. So far everytime i had to work with a SPF (single page file) it was because the company contract ended with their former tech company so as we started to support their in-house apps we also supported their website and had these kind of webpage to support. We had about 3-4 dozen of such projects in the last 6 years i would say and none of them had a single comments so we always redo their website from scratch. But like i said, if there was comments it would probably be supportable. Otherwise it's a bunch of spaghetti code. Seriously a single file with over 120-150 thousands line of code is hell without comments.

 

Long story short : comment, comment, comment ?

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×