1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

JS libraries (cdn) or CSS for article integration into a website

Discussion in 'JavaScript' started by iago111, Jul 8, 2021.

  1. #1
    Hello,
    I have build my homepage with jquery and vue.js. I only use the cdn so no complicated vue framework stuff etc..
    I wrote some articles and I want to integrate these in my homepage. These articles contain text, code and quotes pictures etc.., what is quite demanding if you just use HTML. Are there JS libraries that can help me with that?

    Of course if I could use CSS for this, I would prefer that.

    Thanks, iago
     
    iago111, Jul 8, 2021 IP
  2. FrogeHost

    FrogeHost Member

    Messages:
    39
    Likes Received:
    7
    Best Answers:
    1
    Trophy Points:
    33
    #2
    Why are you using jQuery and Vue together...? This is completely unnecessary.

    Not sure what exactly you meant by "integrate" here. What exactly are you trying to do? Did you want to simply display the articles on the homepage or...?
     
    FrogeHost, Jul 12, 2021 IP
  3. iago111

    iago111 Member

    Messages:
    99
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    33
    #3
    Because I was learning and testing vue.js!! I'm just saying that I don't use any JS development environment like the vueCLI, so no NPM tools or anything like that

    Yes, but formatted, I did it by hand, then you have to escape everything it takes years for one article!
     
    Last edited: Jul 13, 2021
    iago111, Jul 13, 2021 IP
  4. FrogeHost

    FrogeHost Member

    Messages:
    39
    Likes Received:
    7
    Best Answers:
    1
    Trophy Points:
    33
    #4
    share your code or git repo so we can help you find a way to achieve what you want
    don't think there is any lib for what you want to do (if there is it's prolly not the ideal solution)

    I know you said you were just testing things out but don't use vue and jquery together. I'd drop jquery if I were you.
     
    FrogeHost, Jul 16, 2021 IP
  5. iago111

    iago111 Member

    Messages:
    99
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    33
    #5
    https://github.com/Iago0815/homepage

    Just one index.js with all that code, I put every articel into a vue component (
    "emailjs-page","cors-page", "mongodb-page"), I know it looks at bit strange.

    Principally I can do all this with vanillaJS, but I need a tool for these articles, because I must
    escape <> "" etc.
     
    iago111, Jul 17, 2021 IP
  6. FrogeHost

    FrogeHost Member

    Messages:
    39
    Likes Received:
    7
    Best Answers:
    1
    Trophy Points:
    33
    #6
    You could actually use Vue for everything. This issue can be solved by utilizing Vue components and slots. Just check their docs, can't seem to link them here. Again I'm aware you said you were just testing Vue, but if you're willing to take the next step, you'd end up with a much more maintainable project vs. what you currently have.
     
    FrogeHost, Jul 17, 2021 IP
  7. iago111

    iago111 Member

    Messages:
    99
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    33
    #7
    If I want to do vue right, I use the vueCLI and webpack (not just some components and slots) But I will do these things with react, it just takes some time to learn that. So I'm looking for a cdn, as I said before. I would preferably do these things in question with CSS, as I also said before.
     
    iago111, Jul 17, 2021 IP
  8. FrogeHost

    FrogeHost Member

    Messages:
    39
    Likes Received:
    7
    Best Answers:
    1
    Trophy Points:
    33
    #8
    You actually can't properly use "just some components and slots" without utilizing their tooling. It's a prerequisite.

    You said it yourself, "if I want to do vue right..." Truthfully I don't think there is a good way to do what you're looking to do with your current setup. You want to make doing something easier but you don't want to move away from a testing/prototyping setup? What is so complicated with following the setup/installation guide? If you want to continue using the CDN-hosted version of the framework then you have to accept the limitations of it.

    Just to get it out of the way - CSS won't help with the issue you have right now.

    Your index file is over 900 lines long. It's a nightmare to read and much more of a nightmare to maintain. Again you need to make use of single file components (.vue files) if you want to keep using Vue and have a well-organized project at the same time. If you want to do it with React instead, best to start learning that now. Don't want to spend time to learn or reorganize current code? Want to insist on finding a band-aid fix instead and potentially make your current code even worse? Sorry but there's nothing any of us can do about it.
     
    FrogeHost, Jul 18, 2021 IP
  9. iago111

    iago111 Member

    Messages:
    99
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    33
    #9
    Ok, fair enough. The code is 1 year old, you tell me that it shit, ok now I know it. So what!?
    Thanks for the answer!
     
    iago111, Jul 18, 2021 IP
  10. FrogeHost

    FrogeHost Member

    Messages:
    39
    Likes Received:
    7
    Best Answers:
    1
    Trophy Points:
    33
    #10
    Didn't say it just to bash your work. Now that you know it's "shit" (your word not mine) then maybe you could go the right direction instead of trying to maintain "shit" code. Again if you want to keep Vue, just use single file components. It's not hard, really, and your problem will be solved.
     
    FrogeHost, Jul 18, 2021 IP
    Jeoru likes this.
  11. iago111

    iago111 Member

    Messages:
    99
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    33
    #11
    Why don't you try to focus on the topic. I said something about a cdn integration, and you make a "wanna be vue tutorial" out of it. Do you have knowlegede about the vue cli, about webpack or a similar bundler. Do you know how to integrate a vue application in to a node backend or php (laravel e.g.), how to integrate APIs, connect the app to firebase or whatever?
    The reason why I don't continue with vue ist that the "support" (if you can call that support) repsonds in Chinese and I don't speak that language and I'm to LAZY to use google translate. So stick to the topic, pls! Don't chatter away!
     
    Last edited: Jul 19, 2021
    iago111, Jul 19, 2021 IP
  12. Spoiltdiva

    Spoiltdiva Acclaimed Member

    Messages:
    7,732
    Likes Received:
    2,889
    Best Answers:
    53
    Trophy Points:
    520
    #12
    Ha ha ha!...Thanks for the laugh! :rolleyes:
     
    Spoiltdiva, Jul 19, 2021 IP
    Jeoru likes this.
  13. iago111

    iago111 Member

    Messages:
    99
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    33
    #13
    I was not me ment to make s.b. laugh. You are an acclaimed member, can you say something to the topic in question? I want to integrater articles in my homepage. Right now, I'm escaping all the special characters (<> "" '' etc..) which takes a lot of time. The basis should be HTML+CSS+vanillaJS (no vue or react or anything like that)
     
    Last edited: Jul 19, 2021
    iago111, Jul 19, 2021 IP
  14. Spoiltdiva

    Spoiltdiva Acclaimed Member

    Messages:
    7,732
    Likes Received:
    2,889
    Best Answers:
    53
    Trophy Points:
    520
    #14
    The most qualified member we have on this topic is @deathshadow. Now that he has been paged he more than likely will venture an opinion. By the way, a friendly warning: He is not always in a diplomatic frame of mind, but he sure does know his stuff.;)
     
    Spoiltdiva, Jul 20, 2021 IP
  15. iago111

    iago111 Member

    Messages:
    99
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    33
    #15
    God bless that @deathshadow doesn't like framworks like vue or react!
     
    iago111, Jul 20, 2021 IP
  16. FrogeHost

    FrogeHost Member

    Messages:
    39
    Likes Received:
    7
    Best Answers:
    1
    Trophy Points:
    33
    #16
    Yes to all those questions.

    This is not true. And if you're capable of reading the docs you wouldn't even need "support."

    Good luck in whatever you're trying to do.
     
    FrogeHost, Jul 20, 2021 IP
  17. Jeoru

    Jeoru Well-Known Member

    Messages:
    1,115
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    160
    #17
    Sorry but I also find this funny like the other guy. you are a web developer, this is your claim in your website but it seems you do not know the basics of web development.

    You use a framework but don't like a solution using the same. Instead you want to find another framework or library to address a problem you're seeing in the first framework. This is very funny indeed! In the end your work will be a combination of 10 libraries or frameworks for a very simple thing. Get rid of the framework if you dont want to learn it and use it the right way. To me it seems a user was trying to help you but youre just refusing to accept things if you dont agree with it.

    Disclaimer, I don't know the framework youre using but I checked your github code and my gosh that looks like a mess to me. There is NO WAY in hell that is the proper way of using it. Maybe you need to stick with vanilla html+css+js and remove all the jquery and whatever else because again your work is just very chaotic code. Sorry just being honest here and also thanks for the laugh :)
     
    Jeoru, Jul 20, 2021 IP
    Spoiltdiva likes this.
  18. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #18
    Bootcrap and jQuery and Vue, Oh my. Bootcrap and jQuery and Vue, Oh my. Bootcrap and jQuery and Vue, Oh my.

    I would HOPE that in the process -- as you said -- of writing this to learn how to use vue, you've learned what utter incompetent pointless shite it is. More so when it is having multiple pages crapped into one... something that laughably these days you don't even need JavaScript to do!

    ... and I'm NOT joking about that either. It's bad enough the broken half-assed non-semantic markup you've got there, without the endless mindless idiotic "JS for nothing and your scripts for free. That ain't workin', that's not how you do it! Lemme tell ya, these guys ARE dumb!"

    Kind of like the hair of PHP confusing matters because... hmm... you don't know how to CTRL-F5?

    Laugh is i've got an article coming up on doing basically this; the single page WEBSITE, SBW. Since people end up wasting megabytes of script-tardery to take what should be a bunch of single pages and crap them together to avoid pageloads, why bother using JS or separate pages when you can just mimic the behavior with :target? It's what I did on my x86 reference.

    https://x86.cutcodedown.com

    I really have to ask what's with the labels? Even bootcrap's demo doesn't go that re-re given that LABELS are for INPUT, what <input> are those labelling?!? But then the same goes for the scirpttard only vue BS "onclick" for what normal hash tags could handle a thousand times better. Even more comedy is all the paragraphs around things that clearly are NOT paragraphs (like single word links) whilst using double breaks on elements that are QUITE CLEARLY PARAGRAPHS! Ah, can tell bootcrap's "cover" dipshit example a mile away.

    Also your scripts should be INSIDE <body>, not after </body>. Nothing goes between </body> and </html>! EVER!... And how the blazes are you down to <h5> when you don't even have <h4> for them to be subsections of?

    Oh, and there's a lot of why you're struggling. Why are you using <p class="code"> to do the job of <pre><code>? All those non-breaking spaces, incorrect escapes, incorrect quotes in teh code... Gah.

    Overall though, this is why SPA's are those pesky 3i of web development when it comes to conventional websites. Ignorance, incompetence, and ineptitude. Do yourself a favor and just throw ALL of this -- the very CONCEPT of doing all this client-side -- in the garbage. Welcome to why vue.js was created by and used by people unqualified to write websites.

    As proven by that shit-show of a contact form, with scripting doing HTML's job, scripting that prevents accessible use of the form, etc, etc, etc. Especially with the middle finger to accessibility that pages like yours results in.

    It's really how you've got a train wreck of 43k of HTML, CSS, and scripting doing the job of maybe 32k total... and that's not counting the 479k of vue.js rubbish or 143k of bootcrap you really need to go find a stick to scrape off.

    But sure, tell me how turning a 32k static site into a 665k monstrousity made things easier or better.

    If I have time later (working on a medium article right now) I'll do a quick rewrite to show you what I mean about how silly this all is.
     
    deathshadow, Jul 21, 2021 IP