Styleguide icon indicating copy to clipboard operation
Styleguide copied to clipboard

Javascript code

Open lbineau opened this issue 8 years ago • 5 comments

Hi,

I would want to execute some javascript into code snippet or having an "inline javascript" like "inline css". How can I achieve that ? (in the sample below, Vue is undefined) screen shot 2016-06-15 at 15 20 10

Thanks

lbineau avatar Jun 15 '16 13:06 lbineau

Hi lbineau,

You should wait until document is ready to run your Vue code. See example:

Codepen

kestutis-buivydas avatar Jun 15 '16 13:06 kestutis-buivydas

Thanks for replying. The javascript in the code doesn't seem to be embed in the HTML output. screen shot 2016-06-15 at 16 40 43

lbineau avatar Jun 15 '16 14:06 lbineau

No more anwsers ? :(

lbineau avatar Jun 28 '16 09:06 lbineau

@lbineau - if I am right, this is related with issue: http://stackoverflow.com/questions/18369410/how-to-add-javascript-code-into-existing-iframe-using-jquery We need to implement this feature, for now, you can only use javascript global template. There is no simple way, to use inline javascript in snippet code. @miezis - can you confirm?

VaclovasV avatar Jun 28 '16 09:06 VaclovasV

I manage locally to have a inlineJs like inlineCss field. The code is running well but when I print the document inside the iframe, the document is the one from the global page. image Why it is not the one of the iframe, that's the point of iframes right ?

lbineau avatar Jul 05 '16 09:07 lbineau