Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-15-2012, 07:37 PM   PM User | #1
cryoffalcon
Regular Coder

 
Join Date: Oct 2010
Posts: 157
Thanks: 2
Thanked 1 Time in 1 Post
cryoffalcon is an unknown quantity at this point
How to get this type of tryit editor

Hi,
well i saw this editor http://www.w3schools.com/svg/tryit.a...=trysvg_circle at w3schools and i was wondering if there is something like this available for use in one's site. I mean if there is a service that provides you with the editor for your site or if there is a way out to make something like this if there is already a script available.
My knowledge is till html&css so this is what i don't know
cryoffalcon is offline   Reply With Quote
Old 03-15-2012, 09:05 PM   PM User | #2
ckeyrouz
Senior Coder

 
ckeyrouz's Avatar
 
Join Date: Jun 2009
Location: Montreal, Canada
Posts: 1,044
Thanks: 5
Thanked 179 Times in 179 Posts
ckeyrouz is on a distinguished road
I created a quick sample of an HTML editor. try it
Code:
<html>
	<head>
		<script type="text/javascript">
			function display(obj)
			{
			    var obj = document.getElementById("htmlCode");
			    var iframe = document.getElementById("result");
				var doc = iframe.document;

				if(iframe.contentDocument)
				{
			        doc = iframe.contentDocument;
				}
			    else if(iframe.contentWindow)
			    {
			        doc = iframe.contentWindow.document;
			    }
			    // Put the content in the iframe
			    doc.open();
			    doc.writeln(obj.value);
			    doc.close();
				
			}
		</script>
	</head>
	<body>
		<table width="100%" height="100%" border="1	">
			<thead> 
				<tr height="30px">
					<th width="50%">
						<button onclick="display()">Write your code and click me DD</button>
					</th>
					<th>Result</th>
				</tr>
			</thead>
			<tbody>
				<tr height="*">
					<td width="50%" valign="top">
							<textarea cols="115" rows="50" id="htmlCode"></textarea>
					</td>
					<td width="50%" valign="top">
						<iframe id="result" frameborder="1" width="100%" height="100%">
						</iframe>
					</td>
				</tr>
			</tbody>		
		</table>
	</body>
</html>
__________________
Software and cathedrals are much the same - first we build them, then we pray.
ckeyrouz is offline   Reply With Quote
Old 03-15-2012, 09:41 PM   PM User | #3
cryoffalcon
Regular Coder

 
Join Date: Oct 2010
Posts: 157
Thanks: 2
Thanked 1 Time in 1 Post
cryoffalcon is an unknown quantity at this point
FIRST OF ALL thanks alot for really quick reply.
Well i tried almost everything in it like css, css3, html, javascript, jquery, php etc and everything works perfect, just there are two problems.

i-- the result is very small (i hope it is changeable with css)
ii-- sometimes the button doesn't work, like you post the code and then click on it, it doesn't work. but in 20 tests it happened only 2 times with me and i have no clue why did this happen.

At the end i would say, it was really really good to see such small script so much effective, you must be very smart person. Thanks alot ^_^
cryoffalcon is offline   Reply With Quote
Old 03-15-2012, 09:46 PM   PM User | #4
cryoffalcon
Regular Coder

 
Join Date: Oct 2010
Posts: 157
Thanks: 2
Thanked 1 Time in 1 Post
cryoffalcon is an unknown quantity at this point
one more thing i didn't read what you wrote as your signature now i read it and i am laughing now, i am not a software developer but when i am coding before the result appears i am always praying "WELL SAID"
cryoffalcon is offline   Reply With Quote
Old 03-15-2012, 10:12 PM   PM User | #5
ckeyrouz
Senior Coder

 
ckeyrouz's Avatar
 
Join Date: Jun 2009
Location: Montreal, Canada
Posts: 1,044
Thanks: 5
Thanked 179 Times in 179 Posts
ckeyrouz is on a distinguished road
Quote:
Originally Posted by cryoffalcon View Post
FIRST OF ALL thanks alot for really quick reply.
Well i tried almost everything in it like css, css3, html, javascript, jquery, php etc and everything works perfect, just there are two problems.

i-- the result is very small (i hope it is changeable with css)
ii-- sometimes the button doesn't work, like you post the code and then click on it, it doesn't work. but in 20 tests it happened only 2 times with me and i have no clue why did this happen.

At the end i would say, it was really really good to see such small script so much effective, you must be very smart person. Thanks alot ^_^
As I told you I did it quick so I did not take much time in testing all of it. I could have designed a well css.

In all cases I will take a look at it and post a better version in a day or two.
__________________
Software and cathedrals are much the same - first we build them, then we pray.
ckeyrouz is offline   Reply With Quote
Old 03-16-2012, 07:36 AM   PM User | #6
cryoffalcon
Regular Coder

 
Join Date: Oct 2010
Posts: 157
Thanks: 2
Thanked 1 Time in 1 Post
cryoffalcon is an unknown quantity at this point
Thanks for your time and effort, i know you are not going to receive something for it and you don't have anything in your signature as a promotion or backlink, so overall its a pure good deed. I appreciate that cause we beginners grow because of you people.
Take Care.
cryoffalcon is offline   Reply With Quote
Old 03-16-2012, 02:48 PM   PM User | #7
ckeyrouz
Senior Coder

 
ckeyrouz's Avatar
 
Join Date: Jun 2009
Location: Montreal, Canada
Posts: 1,044
Thanks: 5
Thanked 179 Times in 179 Posts
ckeyrouz is on a distinguished road
Quote:
Originally Posted by cryoffalcon View Post
Thanks for your time and effort, i know you are not going to receive something for it and you don't have anything in your signature as a promotion or backlink, so overall its a pure good deed. I appreciate that cause we beginners grow because of you people.
Take Care.
It is the same chain buddy. No one ever grew out of nothing.
Each and every one started by learning and learning from others and got help from others until he became at a certain point capable of helping others.

It would be very bad to stop the chain.
__________________
Software and cathedrals are much the same - first we build them, then we pray.
ckeyrouz is offline   Reply With Quote
Old 03-16-2012, 08:41 PM   PM User | #8
cryoffalcon
Regular Coder

 
Join Date: Oct 2010
Posts: 157
Thanks: 2
Thanked 1 Time in 1 Post
cryoffalcon is an unknown quantity at this point
very soon i will try to become part of this chain, just as i get settled with few things ^_^ and without a doubt i have learnt alot from people, actually all that i know is because of that
cryoffalcon is offline   Reply With Quote
Reply

Bookmarks

Tags
script, tryit editor, w3schools

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:32 AM.


Advertisement
Log in to turn off these ads.