summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSarven Capadisli <csarven@status.net>2009-10-03 22:06:51 +0000
committerSarven Capadisli <csarven@status.net>2009-10-03 22:06:51 +0000
commit5528c0cd3d66c1acd7bf25b26833e8a107641f35 (patch)
treeecb080a0a862fd7e8e541c12aadabf97bdac2a6b /lib
parent1e7df7fbab8a03468a1697240e92f67c82dadced (diff)
Using CDATA for autofocus script
Diffstat (limited to 'lib')
-rw-r--r--lib/htmloutputter.php16
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/htmloutputter.php b/lib/htmloutputter.php
index 64be745be..2ff9380cc 100644
--- a/lib/htmloutputter.php
+++ b/lib/htmloutputter.php
@@ -427,16 +427,12 @@ class HTMLOutputter extends XMLOutputter
function autofocus($id)
{
$this->elementStart('script', array('type' => 'text/javascript'));
- $this->raw('
- <!--
- $(document).ready(function() {
- var el = $("#' . $id . '");
- if (el.length) {
- el.focus();
- }
- });
- -->
- ');
+ $this->raw('/*<![CDATA[*/'.
+ ' $(document).ready(function() {'.
+ ' var el = $("#' . $id . '");'.
+ ' if (el.length) { el.focus(); }'.
+ ' });'.
+ ' /*]]>*/');
$this->elementEnd('script');
}
}