Questions tagged [pure-js]

PURE is a simple and ultra-fast templating tool for generating HTML from an HTML template and JSON data. DO NOT USE this tag if you want to indicate NO LIBRARIES are used.

PURE (Pure Unobtrusive Rendering Engine) is a simple and ultra-fast templating tool for generating HTML from an HTML template and JSON data.

PURE can work as a standalone library or with dojo, DOMAssistant, jQuery, Mootools, prototype.js, Sizzle and Sly.

Key features:

  • Build your templates with HTML, CSS and JavaScript only.
  • Ultra-fast, templates are compiled from HTML to Javascript for blazing rendering speed.
  • Unobtrusive, the HTML remains absolutely untouched.
  • Runs on the browser side.
  • Open Source, and released under the MIT License
49 questions
1
vote
0 answers

how to create simple pagination for change folder html + pure JS

how to create change folder pagination? e.g.: Under folder have some sub-folders, eg: 1, 2, 3,..., future will add A1, A2, A3, A4, ... also will add another name of folders B1, B2, B3, B4, C1, C2, C3 ..., etc. available only choose A's…
Momo Diyer
  • 11
  • 1
1
vote
1 answer

Pure JS. How to add event listener for submit any form

i tried to addEventListener once for all forms on page to serialize and check them before ajax sending. If you have an pill for my broken head, share it pls window.addEventListener('submit', function(e){ //Serialize Form //Ajax…
1
vote
1 answer

Equivalent of jQuery's contents().find() chained methods in pure JS

So I've been trying to do the following bit of code without jQuery: $(".parent-class").contents().find(".child-class").css("color", "red"); I'm trying to edit the styles of an embedded Twitter feed and I could only do that by getting the module's…
Nikitas IO
  • 696
  • 5
  • 20
1
vote
1 answer

jQuery's contents() methods in pure JS

So I've been trying to do the following bit of code without importing the jQuery library: $(".parent-class").contents().find(".child-class").css("color", "red"); I know that .contents() gets the children of each element in the set of matched…
Nikitas IO
  • 696
  • 5
  • 20
1
vote
2 answers

Group array data by name

I'm trying to develop an array with expertise 'Transport' containing each sector and the text assigned to them. This is what I have: - Healthcare -- Data-driven insights to improve healthcare -- Novel data mining and visualisation …
Adam W.
  • 33
  • 5
1
vote
1 answer

How to autorender a JSON array using pure.js?

I am trying to use the pure.js templating engine to convert a JSON array into HTML code. I understand how to use autoRender() to map an associative map to HTML: http://jsfiddle.net/P7H98/ but if I replace the associative map with an array, I end up…
Gili
  • 86,244
  • 97
  • 390
  • 689
0
votes
1 answer

pure JS - get parent DIV ID dynamically through the onlick event

How can I get the ID of each main DIV through the onclick event? I need the element to be found without using static names in the onclick events like the example document.getElementById('fruits'); . I wish there was a way to get to the ID of each…
Edgaras
  • 404
  • 2
  • 16
0
votes
1 answer

removing elements from array which are not numbers using pure js

I'm stuck with one task, hope you could help me I have to return an combined array which consist only from numbers. So if the element has got except for number another character, such element should be removed. I had few ideas. Unfortunately, none…
Elizabeth
  • 1,271
  • 2
  • 5
  • 11
0
votes
1 answer

reset select option while dependencies is default

I use pure js. I'am having difficulty for reseting the select box to default. As you can see on the code below I want to make two select depend on each other. If I choose this it will show only this, but when reseting when I choose the first select…
0
votes
0 answers

Read object data from externel file into const object1

Instead of having the data array in the js-file I would like to read the "Object data" from an external file. const object1 = { Day_1:89, Day_2:80, Day_3:78, Day_4:83, Day_5:89, Day_6:89, …
Mizzy
  • 23
  • 5
0
votes
1 answer

Get a part of string from a page source code (information is present in HTML)

How can I look for a keyword in a HTML source code and get a value from the code using Pure JS. There are multiple code tags and I am looking to extract the value 12345 and it can be in any block which doesn't have a unique ID or class. The…
Sean
  • 33
  • 1
  • 8
0
votes
0 answers

How to get the date after 365 days?

What I am looking for: If current date is 1st january 2020, then i want 31st dec, 2020. If its 1st feb 2020 then i want 31st jan, 2021. Is there any way to get the above result without third party library? What I tried was to add 365 days but…
MhkAsif
  • 537
  • 3
  • 18
0
votes
1 answer

Timer code with the Javascript class and constructor

I have a timer in pure Javascript written with the class and a constructor. There is a problem though, the timer starts before the button "Start" clicked and I can't get why. I need the timer to start only after the button is clicked. Also in my…
0
votes
0 answers

Get object void properties

I get an object: const foo = {} And void this object like foo.div.h2.span how in this object I could catch void parameters? It should be like: object foo voided with div>h2>span parameters? a little bit more examples: Format.div("fqe"); // should…
0
votes
1 answer

Pass data from API to another API nodejs and vanilla Javascript

I'm using geonames API and get data from it with a post request. Now I want to take part of these data (lat, long) and pass it through another API (weatherbit API) as my project need to pass (lat and long) in URL and get data from it I try to make a…