Using CDATA for autofocus script
This commit is contained in:
parent
1e7df7fbab
commit
5528c0cd3d
@ -427,16 +427,12 @@ class HTMLOutputter extends XMLOutputter
|
|||||||
function autofocus($id)
|
function autofocus($id)
|
||||||
{
|
{
|
||||||
$this->elementStart('script', array('type' => 'text/javascript'));
|
$this->elementStart('script', array('type' => 'text/javascript'));
|
||||||
$this->raw('
|
$this->raw('/*<![CDATA[*/'.
|
||||||
<!--
|
' $(document).ready(function() {'.
|
||||||
$(document).ready(function() {
|
' var el = $("#' . $id . '");'.
|
||||||
var el = $("#' . $id . '");
|
' if (el.length) { el.focus(); }'.
|
||||||
if (el.length) {
|
' });'.
|
||||||
el.focus();
|
' /*]]>*/');
|
||||||
}
|
|
||||||
});
|
|
||||||
-->
|
|
||||||
');
|
|
||||||
$this->elementEnd('script');
|
$this->elementEnd('script');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user