forked from GNUsocial/gnu-social
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)
|
||||
{
|
||||
$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');
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user