-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't create snippet from the <form> element #38
Comments
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. |
No, it doesn't. |
Also it skips the
elements. Sad. I need scripts in my snippets... |
Can you update your web sample with something that reproduce this issue and CK On Wed, Jan 2, 2013 at 7:47 AM, dbushenko notifications@github.com wrote:
|
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:
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
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. |
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 |
I am closing this issue because its not something we can fix and a work around was found. |
When using
-- evrything works OK. But if I change that to
-- Enfocus can't create that snippet.
The code looks like this:
The text was updated successfully, but these errors were encountered: