widmogrod / jef Goto Github PK
View Code? Open in Web Editor NEWJavaScript experimental framework
Home Page: http://widmogrod.github.io/jef/example/
License: MIT License
JavaScript experimental framework
Home Page: http://widmogrod.github.io/jef/example/
License: MIT License
Replacing from:
<div class="panel panel-default">
<div class="panel-heading">Discounts details</div>
<div class="panel-body">
<p class="well-sm">No discount rules to show</p>
</div>
<div class="panel-footer">
<div class="row">
<div class="col-md-6">
<button class="btn btn-primary" data-action="add">
<span class="glyphicon glyphicon-plus-sign"></span>
Add discount
</button>
</div>
<div class="col-md-6 text-right">
</div>
</div>
</div>
</div>
To:
<div class="panel panel-default">
<div class="panel-heading">Discounts details</div>
<table class="table table-responsive table-striped">
<tbody><tr>
<th class="col-md-7">Section</th>
<th class="col-md-2">Device</th>
<th class="col-md-2">Discount</th>
<th class="col-md-1"> </th>
</tr>
<tr>
<td>
<input class="discount-section form-control" type="hidden" name="sectionId" data-index="0" value="">
</td>
<td>
<select class="discount-device form-control" name="device" data-index="0">
<option value="">
All
</option>
<option value="mobile">
mobile
</option>
<option value="tablet">
tablet
</option>
<option value="desktop">
desktop
</option>
</select>
</td>
<td>
<div class="input-group input-group-sm">
<input class="form-control" type="number" name="percent" max="100" min="1" data-index="0" value="">
<span class="input-group-addon">%</span>
</div>
</td>
<td>
<button class="btn btn-danger form-control" data-action="remove" data-index="0">
<span class="glyphicon glyphicon-minus-sign"></span>
</button>
</td>
</tr>
</tbody></table>
<div class="panel-footer">
<div class="row">
<div class="col-md-6">
<button class="btn btn-primary" data-action="add">
<span class="glyphicon glyphicon-plus-sign"></span>
Add discount
</button>
</div>
<div class="col-md-6 text-right">
<button class="btn btn-success" data-action="save" disabled="">
<span class="glyphicon glyphicon-floppy-disk"></span>
Save changes
</button>
</div>
</div>
</div>
</div>
Generates:
aElement.children[1].replaceChild(bElement.children[0].children[1], aElement.children[0].children[1]);
aElement.children[0].children[2].children[0].children[1].appendChild(bElement.children[0].children[2].children[0].children[1].children[0]);
And throw error:
Uncaught TypeError: Cannot read property 'replaceChild' of undefined
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.