Hi,
I write a dialog plugin for inserting javascript to head section.
This works. The script is inserted as last child of <head>. But...
If there is something like alert('test'); in script, the alert is execute. How can I avoid execution of inserted scripts? Is there a way or is it a bug in ckeditor?
Same problem with:
Thanks for advice
I write a dialog plugin for inserting javascript to head section.
... onOk : function() { var head = CKEDITOR.instances.metas.document.getHead(); var script = CKEDITOR.dom.element.createFromHtml( '<script type="text/javascript" src="' + myScriptPath + '"></script>' ); head.append( script ); } ...
This works. The script is inserted as last child of <head>. But...
If there is something like alert('test'); in script, the alert is execute. How can I avoid execution of inserted scripts? Is there a way or is it a bug in ckeditor?
Same problem with:
... onOk : function() { var head = CKEDITOR.instances.metas.document.getHead(); head.append( CKEDITOR.document.createElement( 'script', { attributes : { type : 'text/javascript', src : myScriptPath } }) ); } ...
Thanks for advice
Re: insert javascript execute the script
Re: insert javascript execute the script
Re: insert javascript execute the script
Re: insert javascript execute the script
doesn't execute myscript.js (and if it's inserted in sourcemode too). What's different to
where metas is the name of my textarea? Or is this functionality not available yet? I think it's the wrong way to insert a script to header source (config.fullPage : true), but I can't take the insertHtml methode, because I don't know where the cursor is placed. I have multible editors, where metas is the editor for header tags and placed outside my page (invisible).
Re: insert javascript execute the script
Re: insert javascript execute the script
I think it's bug in that version.
Paul Ellis
Re: insert javascript execute the script
Re: insert javascript execute the script
var head = CKEDITOR.instances.metas.document.getHead();
head.append( CKEDITOR.dom.element.createFromHtml( '<script type="text/javascript"
data-cke-saved-src="' + myScriptPath + '"></script>' ) );
I checked and it appears to work
Tks Aaminah
This dont work with ckeditor
This dont work with ckeditor 4. Can someone help me??
Anyone?? All what i need, is
Anyone?? All what i need, is a draggable div. So i think, if you can insert the jquery lib and jquery ui in the iframe, you can work with jquery ui functions... or is there another way to make a div container draggable..?
Like olli9000 said, this isn
Like olli9000 said, this isn't working in version 4. I need this to create a mathquill plugin, but I have to add the mathquill js to the head. I was able to do this, but the script doesn't seem to get notieced, as using mathquill() will not work. It's undefined.
Hi DieterAtWork,
Hi DieterAtWork,
the last version is:
This works in CKEditor 4. But I think you are looking for something like:
It works in the sense that's
It works in the sense that's added to the head, but it's not working for what I need. Maybe I don't get it.
The situation is that the widget plugin will render mathquill, and for that, mathquill() must be called on the element, so I need to call it in the init function of the widget, as there I know the element already exists. But mathquill() is undefined, even thouhg it's added in the head.
Using scriptLoader returns true, so it seems to be successful, but it also doesn't get it to work. I call this in the init function of the plugin, but how should I use it if this is the solution?
Thx for the help.
Sorry, I think I can't help
Sorry, I think I can't help you. I use scriptLoader in some of my plugins to load external JS files and I can call every function in it from my plugins. So there will be another issue in your plugin. But I can remember it is not easy to write a plugin. I had spent weeks for it.
I did work after all, there
I did work after all, there was something else I was doing wrong. Mathquill adds it's methods to jQuery objects, and it's there I got confused. But in the end, I didn't used any method to add scripts, as it seems that loading the script in the page itself was doing the trick, as the dialog isn't in the editor, but on the page. Thx for the help.