Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [JavaScript]SCEditor
kamilo818
post
Post #1





Grupa: Zarejestrowani
Postów: 250
Pomógł: 11
Dołączył: 20.01.2014

Ostrzeżenie: (0%)
-----


  1. <head>
  2. <link rel="stylesheet" href="minified/themes/default.min.css" type="text/css" media="all" />
  3. <script type="text/javascript" src="minified/jquery.sceditor.bbcode.min.js"></script>
  4.  
  5. <style>
  6. .test, #editor, .edit, .test2{
  7. width:600px;
  8. min-height:200px;
  9. border:1px solid;
  10. }
  11. textarea{
  12. width:100%;
  13. min-height:200px;
  14. }
  15. </style>
  16. <script>
  17.  
  18.  
  19. $(document).ready(function() {
  20. $('input.btn2').click(function(){
  21. var b = $("#editor2").val();
  22. $('div.test2').html(b);
  23. alert(b);
  24. });
  25.  
  26. $(function() {
  27. $("#editor2").sceditor({
  28. plugins: "bbcode",
  29. style: "minified/jquery.sceditor.default.min.css"
  30. });
  31. });
  32.  
  33. });
  34.  
  35. </script>
  36. </head>
  37.  
  38. <body>
  39. <div class="edit">
  40. <textarea id="editor2"></textarea>
  41. </div>
  42.  
  43. <input type="button" class ="btn2" value="Zapisz"/>
  44.  
  45. <div class="test2"></div>
  46. </body>


Jak pobrać wartosc z SCEditor i wpisać ją do div.test2?
Czytałem dokumentację ale nie mogę sobie poradzić.
Go to the top of the page
+Quote Post
Turson
post
Post #2





Grupa: Zarejestrowani
Postów: 4 291
Pomógł: 829
Dołączył: 14.02.2009
Skąd: łódź

Ostrzeżenie: (0%)
-----


Zobacz w źródło #editor2 bo pewnie tam jest kolejny dokument html
Go to the top of the page
+Quote Post
trueblue
post
Post #3





Grupa: Zarejestrowani
Postów: 6 806
Pomógł: 1828
Dołączył: 11.03.2014

Ostrzeżenie: (0%)
-----


http://www.sceditor.com/api/sceditor/val/
Go to the top of the page
+Quote Post
kamilo818
post
Post #4





Grupa: Zarejestrowani
Postów: 250
Pomógł: 11
Dołączył: 20.01.2014

Ostrzeżenie: (0%)
-----


Cytat(trueblue @ 3.09.2014, 16:39:39 ) *

czytałem to ale nie wiem jak użyć. Próbowałem ale nie wyszło.

edit: ok już wiem (IMG:style_emoticons/default/smile.gif)

edit2:
Ok ale jak odczytuje to tak:
  1. $('input.btn2').click(function(){
  2.  
  3. var b = $('#editor2').sceditor('instance').val();
  4. $('div.test2').html(b);
  5. });


to wpisuje mi do diva bbcode. A jak to przerobić na html?(IMG:style_emoticons/default/smile.gif)

Ten post edytował kamilo818 3.09.2014, 15:54:04
Go to the top of the page
+Quote Post
trueblue
post
Post #5





Grupa: Zarejestrowani
Postów: 6 806
Pomógł: 1828
Dołączył: 11.03.2014

Ostrzeżenie: (0%)
-----


http://www.sceditor.com/api/sceditor/getsourceeditorvalue/
http://www.sceditor.com/api/sceditor/getwysiwygeditorvalue/
Go to the top of the page
+Quote Post
kamilo818
post
Post #6





Grupa: Zarejestrowani
Postów: 250
Pomógł: 11
Dołączył: 20.01.2014

Ostrzeżenie: (0%)
-----


Poddaje się. Nie wiem jak to zastosować (IMG:style_emoticons/default/sad.gif)
Go to the top of the page
+Quote Post
trueblue
post
Post #7





Grupa: Zarejestrowani
Postów: 6 806
Pomógł: 1828
Dołączył: 11.03.2014

Ostrzeżenie: (0%)
-----


Wyłącz plugin bbcode.
Go to the top of the page
+Quote Post
kamilo818
post
Post #8





Grupa: Zarejestrowani
Postów: 250
Pomógł: 11
Dołączył: 20.01.2014

Ostrzeżenie: (0%)
-----


no działa...
A powiedz mi jeszcze za co odpowiadał ten plugin?
Go to the top of the page
+Quote Post
trueblue
post
Post #9





Grupa: Zarejestrowani
Postów: 6 806
Pomógł: 1828
Dołączył: 11.03.2014

Ostrzeżenie: (0%)
-----


Przecież sam o tym pisałeś.
Cytat(kamilo818 @ 3.09.2014, 16:45:26 ) *
to wpisuje mi do diva bbcode. A jak to przerobić na html?(IMG:style_emoticons/default/smile.gif)

Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 28.08.2025 - 17:15