Note: If this lesson seems a bit unclear to you, you may want to check basic bbCode lessons: How Does bbCode Work? & How to Correctly Insert Tags.
You can insert HTML, PHP, Javascript codes, etc into special boxes using bbCode, the text inserted in the code box will be converted to a fixed-width (monospace) font, & ensures that nothing from the code is lost when you submit your message.
The tag for code is [code]. Its use is not different from the use of other tags we saw, it should wrap the code you want to be in the box.
Example:
Let's wrap an example of Javascript code:
[code]
<script type="text/javascript">
<!-- alert("Hello world!"); //-->
</script>
[/code]
Here's the result you would get:
Code:
<script type="text/javascript">
<!--
alert("Hello world!");
//-->
</script>
0 comments:
Post a Comment