No edit summary |
(remove <nowiki> from example; categorize basic as per http://docs.simplemachines.org/index.php?topic=57) |
||
Line 6: | Line 6: | ||
str += ' ' + node.attributes[i].nodeName + '="' + node.attributes[i].nodeValue + '"';</code></td></tr> | str += ' ' + node.attributes[i].nodeName + '="' + node.attributes[i].nodeValue + '"';</code></td></tr> | ||
<tr><td | <tr><td>[code]<?php echo "Hello world!"; ?></code></td><td>If php code is placed inside, with the initial <?php tag, then it will be color formated according to php syntax.</td><td><div class="codeheader">: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation"></a></div><code><span style="color: #000000"><span style="color: #0000BB"><?php </span><span style="color: #007700">echo </span><span style="color: #DD0000">"Hello world!"</span><span style="color: #007700">; </span><span style="color: #0000BB">?></span></span></code></td></tr> | ||
[[Category:Bulletin_Board_Code]] | [[Category:Bulletin_Board_Code]] | ||
{{Cleanup html}} | |||
[[Category:Basic Bulletin Board Code]] |
Revision as of 14:29, 7 January 2011
[code]if (node.attributes[i].nodeValue != null) str += ' ' + node.attributes[i].nodeName + '="' + node.attributes[i].nodeValue + '"';[/code]The code tag outputs code directly with simple formatting. Any BB Codes, html, php, javascript, c++, or any other text will be outputted exactly the same. The box will scroll for long lines so that the line breaks are preserved at the correct places, which is important in many languages. This is a block level tag.
if (node.attributes[i].nodeValue != null)
str += ' ' + node.attributes[i].nodeName + '="' + node.attributes[i].nodeValue + '"';
[code]<?php echo "Hello world!"; ?>If php code is placed inside, with the initial <?php tag, then it will be color formated according to php syntax.
<?php echo "Hello world!"; ?>
This article may have been copied from the the forum-based Online Manual and contain some HTML remnants that need to be cleaned up. Please clean it up. This template may be removed when cleanup is complete. |