47 3304 acoder 16,027
Recognized Expert Moderator MVP
Hi
I tried to alert the code=documen.cr eateText....to get to know whether this function is getting the textarea2 but it is showing only object in alert message. So if textarea2 is not coming to the function how it will execute the editor.
document.create TextNode() just creates a text node. appendChild adds it to the page. When the textarea has been added to the page via Ajax, then put this code after it. Note that this means that you will need to modify the PHP page. If you can't modify the page, you will need to parse the page to just get the HTML body for display and the JavaScript has to be added as I have described earlier.
document.create TextNode() just creates a text node. appendChild adds it to the page. When the textarea has been added to the page via Ajax, then put this code after it. Note that this means that you will need to modify the PHP page. If you can't modify the page, you will need to parse the page to just get the HTML body for display and the JavaScript has to be added as I have described earlier.
Hi
I am not able to do it. So if you may please help me out by modifying the code where it is necessary. I will be highle obliged to you. I know I must not say to you to write code but I think now I have messed up with the things. So please help me!
Thanks.
acoder 16,027
Recognized Expert Moderator MVP
I am not able to do it. So if you may please help me out by modifying the code where it is necessary. I will be highle obliged to you. I know I must not say to you to write code but I think now I have messed up with the things. So please help me!
Show your latest version of the code.
acoder 16,027
Recognized Expert Moderator MVP
The code which adds the scripts to the page should be added when content.html is called, otherwise it's not needed. If you're going to add them to the page before the option is selected, you might as well add them in the standard way, e.g.: - <script type="text/javascript" src="wysiwyg.js"></script>
The code which adds the scripts to the page should be added when content.html is called, otherwise it's not needed. If you're going to add them to the page before the option is selected, you might as well add them in the standard way, e.g.: - <script type="text/javascript" src="wysiwyg.js"></script>
Hi if you may do some modification to this code than it would be better for me just highlight the changes in the given code. Please!
Thanks
acoder 16,027
Recognized Expert Moderator MVP
Here are some possible changes: - <html xmlns="http://www.w3.org/1999/xhtml">
-
<head>
-
<script type="text/javascript" src="Get_Page.js"></script>
-
<script type="text/javascript" src = "wysiwyg.js"></script>
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-
<title>Untitled Document</title>
-
</head>
-
-
<body>
-
<form>
-
<select id="attachMoreLink" name="select" onchange="getPage(this.value)">
-
<option selected="selected">--Select One--</option>
-
<option value="image">Image</option>
-
<option value="content">Text</option>
-
-
</select>
-
<div id="txtHint"> text will be displayed here</div>
-
</form>
-
</body>
-
</html>
//Get_Page.js -
-
var xmlHttp;
-
var chosenOption;
-
function getPage(str)
-
{
-
chosenOption = str;
-
xmlHttp=GetXmlHttpObject()
-
if (xmlHttp==null)
-
{
-
alert ("Browser does not support HTTP Request");
-
return;
-
}
-
var image="image";
-
if(str==image)
-
{
-
var url="Get_Page.php";
-
url=url+"?q="+str;
-
url=url+"&sid="+Math.random();
-
xmlHttp.onreadystatechange=stateChanged ;
-
xmlHttp.open("GET",url,true);
-
xmlHttp.send(null);
-
}
-
else if(str=="content")
-
{
-
var url="content.html";
-
url=url+"?q="+str;
-
url=url+"&sid="+Math.random();
-
xmlHttp.onreadystatechange=stateChanged ;
-
xmlHttp.open("GET",url,true);
-
xmlHttp.send(null);
-
}
-
-
}
-
function stateChanged()
-
{
-
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
-
{
-
document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
-
if (chosenOption == "content") generate_wysiwyg('textarea2');
-
}
-
}
-
//content.html -
<table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
-
<tr align="left">
-
<td width="14%" align="left" valign="middle">Content Id </td>
-
<td width="86%" valign="middle"><input type="text" name="Content_Id" value="" /></td>
-
</tr>
-
<tr align="left">
-
<td valign="middle" align="left">Content Name </td>
-
<td valign="middle"><input type="text" name="Content_Name" value="" /></td>
-
</tr>
-
<tr align="left">
-
<td align="left" valign="top">Description</td>
-
<td valign="middle"><textarea id="textarea2" name="Content_Description" style="height: 200px; width: 500px;">
-
-
</textarea>
-
</td>
-
</tr>
-
<tr align="left">
-
<td valign="middle"> </td>
-
<td valign="middle"><input type="submit" name="Content" value="Add Content" />
-
<input name="reset" type="reset" /></td>
-
</tr>
-
</table>
-
Woowwwwwwwww!!! !!!!! Grea88888888888 888888.
Thanks. I am so happy now. Really you made me happy
Thanks a lot
Here are some possible changes:
Woowwwwwwwww!!! !!!!! Grea88888888888 888888.
Thanks. I am so happy now. Really you made me happy
Thanks a lot
acoder 16,027
Recognized Expert Moderator MVP
No problem! Glad it worked. If you have any more questions, just post again to the forum.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Bruce W...1 |
last post by:
This is a best practices question.
For a website where PHP is used, does it make sense to have both .htm and .php
files? In other words, for pages that have no active content there's no point
in naming them with a .php extension.
Is there any advantage or disadvantage to making all files .php, or the same for
mixing them with .htm files?
What do you do, and why?
|
by: Rob Long |
last post by:
Hey,
I've written a custom HTML library using many PHP scripts as seperate
files (just like I'd do a java project) and I'm having some problems
where I'm including scripts in different directories from already
included scripts... basically where there'a an include chain spanning
multiple directories.
I've reduced the problem to its core:
|
by: Keith |
last post by:
I have a block of ASP code (enclosed in <% .. %>).
How can I call that piece of code from another piece of similar code?
And can the code be in any order on the page for it to work?
Thanks
|
by: Chad Richardson |
last post by:
As I'm writing this I think I am answering my own question, but I'd like to
get any other ideas on the subject as well.
I have a standard Header.asp that I want to include in every other page in
my site. Header.asp is located in the root folder, but the calling pages are
in various folders/levels. Since the relative paths specified in header are
subject to change and are based on the relative path of the calling page,
problems arise....
|
by: WisTex |
last post by:
I've come across a very weird problem. Virtual includes work on all my ASP pages on the entire website, including those in subdirectories, yet they won't work on a particular page I created, even though the virtual include statement is copy & pasted exactly as it appears on the working pages.
What would cause virtual includes to work in one page on a website, but not on another?
Error Message:
Microsoft VBScript runtime error...
| |
by: Josiah Manson |
last post by:
I found that I was repeating the same couple of lines over and over in
a function and decided to split those lines into a nested function
after copying one too many minor changes all over. The only problem is
that my little helper function doesn't work! It claims that a variable
doesn't exist. If I move the variable declaration, it finds the
variable, but can't change it. Declaring the variable global in the
nested function doesn't work...
|
by: supasnail |
last post by:
I have a happily working set of asp pages which read from the database
via include file "./_private/include/database.mdb".
However, when I try to gain access to this database on pages one
folder removed using "../_private/include/database.mdb", the pages
won't display. This whole system works fine on my home test server
(iis.5.0), but 'breaks' when uploaded to the public server. I know the
path to database is correct because the upper...
|
by: Atlas |
last post by:
I'm working on a multilanguage ASP/HTML site using a IIS6 web server.
It perfectly works with two languages (english and italian) in this way:
- basically the same ASP code for every language
- language-specific content is stored in text files, every language has it's
own directory contents.
- to enhance usability and formatting the language-specific contents are
stored with html syntax; basically the code that normally stands between...
|
by: henry |
last post by:
Folks
Here's a skeleton, generic HTML page, call it "index.php". You'll see a bit
of php code in the middle:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |