Comments (7)
I should be able to test this today. I am very interested in what is happening here as there should be no difference in a form vs a div as long as the id's don't conflict. Does the form have a name element.
from enfocus.
No, it doesn't.
from enfocus.
Also it skips the
<script> . . . </script>
elements. Sad. I need scripts in my snippets...
from enfocus.
Can you update your web sample with something that reproduce this issue and
the expected result so I can try to reproduce it.
CK
On Wed, Jan 2, 2013 at 7:47 AM, dbushenko [email protected] wrote:
Also it skips the . . . elements. Sad. I need scripts in my snippets...
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/38#issuecomment-11806838.
from enfocus.
Looks like that might not be a bug, but a feature...
Although this feature is not so convinent to my mind. I have updated my project (https://github.com/dbushenko/websample), please have a look. In main.cljs I create the snippet my-snippet which contains the following html:
<div id="mytest">
<script type="text/javascript">
alert("Hello, Creig!");
</script>
<div id="this">
</div>
Hello from Enfocus!
</div>
If you open the file snippets.html in your browser, you will certainly see the popup message. But when I create a snippet from this html and inject that snippet into main.html page, the javascript code is not evaluated. I cannot run any code when the snippet is shown; also I cannot add any definitions. E.g. when I change the js code to the following
function myfunc() { alert("Hello, Creig!"); }
I still cannot use the function 'myfunc()'.
I don't know whether I have to complain about this issue, probably this behavior is explained by the architecture design.
from enfocus.
It is an architectural thing that prevents this but you might be able to get around it. let me think about it for awhile but I was thinking you could have a custom transform that could be run on script tag in the snippet (after you add it to the dom) that would eval that scripts. I have not tried the below snippet but it kind of what I am thinking.
(def evaljs
(em/trans [node] (js/eval (.innerHTML node))))
CK
from enfocus.
I am closing this issue because its not something we can fix and a work around was found.
from enfocus.
Related Issues (20)
- Need escape content in ef/content or make other function that do correct html escaping.
- transform object DocumentFragment to string HOT 5
- event handler functions within hiccup-html HOT 2
- replace-vars broken in clojurescript 1.7.145 HOT 6
- Great project
- Extractor extract node HOT 1
- Clone-for and lists HOT 15
- Hiccup input control - checked and disabled not working HOT 2
- Requiring enfocus.macros under Clojure 1.10 and above triggers an error
- compiling fails at target/cljsbuild-compiler-0/enfocus/core.cljs HOT 4
- get-prop doesn't work on data attributes HOT 1
- listen-live looses event information HOT 6
- Multiple Extractions HOT 5
- Add optional callback for when view-binding function completed HOT 6
- debug should be set to false by default HOT 4
- (read-form) on IE8 results in [object]is not ISeqable HOT 7
- How can I use holder.js in html snippet? HOT 4
- Difference in ef/content behaviour HOT 2
- clone-for issue "TypeError: enfocus.core.last_element_child is undefined" HOT 1
- Function based inline snippets HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.