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
8
votes
1 answer

Ruby on Rails, json vs js ajax response

I'm curious what is the best way to respond to an ajax request, is it sending json, and then parse it at the client side (for example with pure) or should I render javascript at the server side and return the result(with a js.erb template)?
jonepatr
  • 7,769
  • 7
  • 30
  • 53
4
votes
1 answer

Is "Conditional Rendering" possible with Pure JS?

I use Pure JS directives for rendering: http://beebole.com/pure/documentation/rendering-with-directives/ If a node in the template is missing, the default behaviour of Pure JS is to crash due to: The node "XXX" was not found in the template This…
Roberto Aloi
  • 30,570
  • 21
  • 75
  • 112
4
votes
0 answers

Difference between req.param = function(){} and req.param = function param() {}

I was looking into express.js repository and noticed that, for example, authors created req object and his methods by using this code: req.param = function param(name, defaultValue) {}... but in some others methods they have this code: req.accepts…
4
votes
1 answer

Drupal 8 Drupal.behaviors without jquery

Is there a way to add drupal behaviors to a theme without invoking jquery in Drupal 8? This is what the tutorial show: (function ($, Drupal) { Drupal.behaviors.myModuleBehavior = { attach: function (context, settings) { …
wolfhowling
  • 83
  • 1
  • 7
3
votes
3 answers

Why the HTML DOM event doesn't affect immediately on the same DOM element?

I'm writing the code to change the Button element value when the click event is executing. But Until it finishes it doesn't affect the button element value. I attached the fiddle example which will give you a good idea of what I'm talking…
Irf92
  • 319
  • 2
  • 14
3
votes
1 answer

Copy data attribute to clipboard on click with purejs

I have list of images. I want to copy data attribute on click to clipboard. What I have now is alert data-attribute. I tried copy command but it didn't work (don't copy anything). Please, can anyone help me with that? var emojiImages =…
MMPL1
  • 533
  • 7
  • 21
2
votes
1 answer

Using PURE.js to fed the HTML with JSON

Can i use pure.js and jquery to display my HTML content via Json? The reason is to check if anybody has used this method before and have been successful. url for ref: http://beebole.com/pure/documentation/get-started/
Vinay
  • 79
  • 8
2
votes
1 answer

How to rebuild DOM after a resize event if it is being constructed from JS

I'm working in a project implementing a masonry gallery. It works pretty well, but i need that the amount of columns is dynamically adjusted in the JS contruct call... I've tried different approaches with resize event, while loops, conditional if's,…
Rodo
  • 23
  • 3
2
votes
3 answers

Is it possible to insert new HTML with pure.js

I am searching for something which renders an HTML template starting from a JSON file of data. The matter is that the plugin/framework/library I'm searching for must create itself the template structure, starting from something very…
Simona Adriani
  • 561
  • 6
  • 16
2
votes
4 answers

jQuery: Templating data

I have a unique situation where I'm building a site that will call data via AJAX and load it into "containers" (basically just divs styled and arranged according to elements retrieved from the AJAX callback). I'm not sure how many of these unique…
KeyboardInterrupt
  • 3,483
  • 8
  • 36
  • 41
2
votes
1 answer
1
vote
2 answers

Use JSON URL Data to Dynamically Fill A HTML Table

I have this HTML table on my page and I want to fill it dynamically with data from this JSON URL: http://services.runescape.com/m=itemdb_rs/api/catalogue/detail.json?item=1055 I honestly don't know the best way to do this but from what I've found…
Pixel Life
  • 13
  • 1
  • 4
1
vote
3 answers

Working on transforming array object data where it's taking same value for each indexes while converting it to other format

I have an issue transforming array object data into required format. With my solution it's transforming it correctly but it's copying same last index data for each item in array. Input: let data = [ { 0: { value1: true, value2:…
1
vote
0 answers

How to access event.clientX outside of window function?

I tried to use the event.clientX outside of window function. But it says xAxis is not defined. Can have an way to get it? My code below, window.onclick = function(event) { let xAxis = event.clientX; } alert(xAxis);
1
vote
2 answers

How to call external api's data from backend to frontend side?

I'm trying to weather Api app using node, express and Axios in backend part without using any framework like Angular or react. I have 3 main file for my codes. index.html customer.js (for front end part) server.js (for backend part) My backend…
CeydaU
  • 11
  • 1
  • 3
1
2 3 4