cbmtrx / rte-light

Automatically exported from code.google.com/p/rte-light
0 stars 0 forks source link

Add help to retrieve content #4

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This plugin is looking very nice and its very light weight makes it appealing.
However, I couldn't retrieve the iframe's content with jQuery.
How should it be done ?
This could be added to the index.html for more convenience. 

Original issue reported on code.google.com by thomas.d...@gmail.com on 1 Apr 2009 at 8:29

GoogleCodeExporter commented 9 years ago
achieved to get contents through 
$("#"+id_textarea).rte.html($("iframe")[0])
is it the oficial way ?
if yes, shouldn't it be another one ?

Original comment by thomas.d...@gmail.com on 1 Apr 2009 at 9:00

GoogleCodeExporter commented 9 years ago
anyone got the way of get content value?
pls paste to here,thx.

Original comment by mati...@gmail.com on 15 Apr 2009 at 9:09

GoogleCodeExporter commented 9 years ago
I have managed to get the content of the form to appear, the below is an 
example of getting it to appear 
in an alert box:

>Within the jquery script add a button click event attached to a button 
somewhere on the HTML page - 
note: you might have to put the button outside of the <form></form> element.

> $('#showBtn').click(function() { //when button (with ID showBtn) is clicked
alert(iframe.contentWindow.document.getElementsByTagName("body")[0].innerHTML); 
//show content entered in 
textarea - the texarea is actually an iFrame!
});

>That should do the trick ;) - obviously change to meet you needs, i.e. stick 
the content in a DIV or 
Database

Cheers

Original comment by matt...@chamnet.com on 12 May 2009 at 1:31

GoogleCodeExporter commented 9 years ago
try the code below, it's work for me

$(document).ready(function() {

  arr_Editor = $('#intro').rte({    
        css: ['default.css'],
        width: 600,
        height: 250,
        controls_rte: rte_toolbar,
        controls_html: html_toolbar
    });

    arr_Editor = $('#desc').rte({
        css: ['default.css'],
        width: 600,
        height: 250,
        controls_rte: rte_toolbar,
        controls_html: html_toolbar
    }, arr_Editor);

  arr_Editor = $('#buydesc').rte({
        css: ['default.css'],
        width: 600,
        height: 250,
        controls_rte: rte_toolbar,
        controls_html: html_toolbar
    }, arr_Editor);

});

arr_Editor["intro"].get_content()

Original comment by bipolet@gmail.com on 24 Jul 2009 at 4:21

GoogleCodeExporter commented 9 years ago
How world you go about adding contents to the iframe from outside the jquery 
while 
still using the exec command

Original comment by andrew.d...@gmail.com on 15 Sep 2009 at 10:59

GoogleCodeExporter commented 9 years ago
Hi.

I had to add the following jquery code to populate textareas when a submit 
button is
clicked (it also could have been done with the form's onclick event ...).
It works but shouldn't this be done atomagically by rte ?

$('input[type="submit"]').click(function () {
  $("textarea.rte-zone").each(function()  
    var iframe = $('iframe[title="'+this.name+'"]');
    this.value=$(iframe).contents().find("body").html();
  });
});

Original comment by mike.bar...@gmail.com on 18 Oct 2009 at 9:15

GoogleCodeExporter commented 9 years ago
hell only a year late to the game but this one worked for me

$(".rte-zone").contents().find(".frameBody").html());

Original comment by WebD...@gmail.com on 21 Apr 2010 at 8:56

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
To solve the problem of the submit problem, you have to use the js files that 
are accessible if you know how using this link and his solution:
http://batiste.dosimple.ch/blog/posts/2007-09-11-1/rich-text-editor-jquery.html

Please be aware that for the picture url you have to add a "folder_name/" that 
includes the slash.

Original comment by Grandlis...@gmail.com on 31 Oct 2013 at 1:15