473,372 Members | 877 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

problem using tinymce

45
hi everyone,

i have used tinymce editor in my project, but i have some problem like whenever i am selecting data from database and when i want to wiew the details of that particular section then it showing including the tinymce editor TAGS that i doo not want i mean when somebody want to view the details then it should show only normal font not TAGS of editor.

and one more problem i am opening a DIV on click of link using AJAX and i want tinymce editor in that DIV which is for edit but it not showing editor it showing only normal TEXTAREA. how can i embed tinymce in TEXTAREA of DIV while i am using AJAX.
please help me

thanx to all...
Jan 30 '09 #1
7 3559
acoder
16,027 Expert Mod 8TB
Could you post a link or some code.
Jan 31 '09 #2
tokcy
45
here is code for tine mce
Expand|Select|Wrap|Line Numbers
  1. <!-- TinyMCE -->
  2. <script type="text/javascript" src="tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
  3. <script type="text/javascript">
  4.     tinyMCE.init({
  5.  
  6.         // General options
  7.         mode : "textareas",
  8.         theme : "simple",
  9.         content_css : "tinymce/css/word.css",
  10.  
  11.         // Drop lists for link/image/media/template dialogs
  12.         template_external_list_url : "tinymce/lists/template_list.js",
  13.         external_link_list_url : "tinymce/lists/link_list.js",
  14.         external_image_list_url : "tinymce/lists/image_list.js",
  15.         media_external_list_url : "tinymce/lists/media_list.js",
  16.  
  17.         // Replace values for the template plugin
  18.         template_replace_values : {
  19.             username : "Some User",
  20.             staffid : "991234"
  21.         }
  22.     });
  23. </script>
  24. <form>
  25. <textarea id="description" name="description" rows="10" cols="50" style="width:300px"><?=$str1?>
  26. </textarea>
  27. </form>
  28.  
  29. on another page 
  30. <div id="showallcat"></div>
  31. in the same page
  32. onclick of edit section i am calling div using ajax in this page i want to embed tinymce.
  33.  
Feb 1 '09 #3
acoder
16,027 Expert Mod 8TB
Dealing with the second problem first: you need to eval the JavaScript or include it within the calling page.
Feb 1 '09 #4
tokcy
45
I have solve the first problem but still i am chasing second problem and according to you i need to include within calling page so i am doing the same but my prob is still there.
Feb 2 '09 #5
acoder
16,027 Expert Mod 8TB
By the calling page, I mean the page where the Ajax request is made, not the page being requested.

Can you show all of the relevant Ajax/page code.
Feb 2 '09 #6
tokcy
45
Expand|Select|Wrap|Line Numbers
  1. function showadd(str,str1,str2,str3)
  2. {
  3.     document.getElementById('showallcat').style.display='block';
  4.     displaydiv(str,str1,str2,str3);
  5. }
  6. function closediv()
  7. {
  8. document.getElementById('showallcat').style.display='none';
  9. }
  10.  
  11.  
  12. function displaydiv(str,str1,str2,str3)
  13.     xmlHttp=GetXmlHttpObject()
  14.     var url=str
  15.     //alert(str1);
  16.     //alert(xmlHttp.responseText );
  17.     url=url+"?id="+str1+"&mid="+str2+"&ssid="+str3
  18.     //alert(url);
  19.     url=url+"&sid="+Math.random()
  20.     xmlHttp.onreadystatechange=stateChanged 
  21.     xmlHttp.open("GET",url,true)
  22.     xmlHttp.send(null)
  23. }
  24. function stateChanged() 
  25.  
  26. if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
  27.  {
  28.  document.getElementById("showallcat").innerHTML=xmlHttp.responseText
  29.  } 
  30. }
  31. function GetXmlHttpObject()
  32. {
  33. var xmlHttp=null;
  34. try
  35.  {
  36.  // Firefox, Opera 8.0+, Safari
  37.  xmlHttp=new XMLHttpRequest();
  38.  }
  39. catch (e)
  40.  {
  41.  //Internet Explorer
  42.  try
  43.   {
  44.   xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  45.   }
  46.  catch (e)
  47.   {
  48.   xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  49.   }
  50.  }
  51. return xmlHttp;
  52. }
  53.  
  54.  
Feb 3 '09 #7
acoder
16,027 Expert Mod 8TB
Is the TinyMCE code in the URL that's passed to this Ajax function? If it is, the JavaScript code will need to be evaled. Any script tags will need to be included in the parent page too.

What I would suggest is to separate the content, so you have HTML and JavaScript separate and then you can deal with them appropriately.
Feb 3 '09 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Aaron Prohaska | last post by:
I have just run into a problem where I have a page that posts back to itself to execute code, except when the page does the post back it somehow executes code that is in our home page for the site....
9
by: Rajat Tandon | last post by:
Hello there, I am relatively new to the newsgroups and C#. I have never been disappointed with the groups and always got the prompt replies to my queries.This is yet another strange issue, I am...
8
by: vunet.us | last post by:
Hi all, I have difficulties initializing TinyMCE. Initialization involved 1 included file tiny_mce.js and one which I include "on demand" (see tinyMCEOnDemand()). The content of that function is...
5
matheussousuke
by: matheussousuke | last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails. The goal is: Make it send the email with the URL...
2
by: kenatessence | last post by:
Hello, I am working on making a flash site dynamic by using XML. I have already made the flash site read the XML perfectly, but i now have to make a back end where the owner can go in and post new...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.