本文整理匯總了PHP中utf8::encode_javascript方法的典型用法代碼示例。如果您正苦於以下問題:PHP utf8::encode_javascript方法的具體用法?PHP utf8::encode_javascript怎麽用?PHP utf8::encode_javascript使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類utf8
的用法示例。
在下文中一共展示了utf8::encode_javascript方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: footer
//.........這裏部分代碼省略.........
var errorDiv = document.getElementById("foldererror");
if (albumArray && contains(albumArray, folderObj.value)) {
errorDiv.style.display = "block";
} else {
errorDiv.style.display = "none";
}
}
function toggleAutogen(fieldID, nameID, checkbox) {
var field = document.getElementById(fieldID);
var name = document.getElementById(nameID);
if (checkbox.checked) {
window.folderbackup = field.value;
field.disabled = true;
updateFolder(name, fieldID, checkbox.id);
} else {
if (window.folderbackup && window.folderbackup != "")
field.value = window.folderbackup;
field.disabled = false;
}
}
function startUpload(folder) {
var xml = window.external.Property('TransferManifest');
var files = xml.selectNodes('transfermanifest/filelist/file');
for (i = 0; i < files.length; i++) {
var postTag = xml.createNode(1, 'post', '');
postTag.setAttribute('href', '<?php
echo FULLWEBPATH . '/' . basename(__FILE__) . '?cmd=upload';
?>
&folder=' + folder);
postTag.setAttribute('name', 'userpicture');
var dataTag = xml.createNode(1, 'formdata', '');
dataTag.setAttribute('name', 'MAX_FILE_SIZE');
dataTag.text = '10000000';
postTag.appendChild(dataTag);
files.item(i).appendChild(postTag);
}
var uploadTag = xml.createNode(1, 'uploadinfo', '');
uploadTag.setAttribute('friendlyname', '<?php
echo utf8::encode_javascript(getOption('gallery_title'));
?>
');
var htmluiTag = xml.createNode(1, 'htmlui', '');
htmluiTag.text = '<?php
echo utf8::encode_javascript(FULLWEBPATH);
?>
';
uploadTag.appendChild(htmluiTag);
xml.documentElement.appendChild(uploadTag);
window.external.Property('TransferManifest')=xml;
window.external.SetWizardButtons(true,true,true);
content.innerHtml=xml;
window.external.FinalNext();
}
function OnBack() {
<?php
echo $this->onBack;
?>
}
function OnNext() {
<?php
echo $this->onNext;
?>
}
function OnCancel() {
<?php
echo $this->onCancel;
?>
}
function window.onload() {
window.external.SetWizardButtons(1,1,0);
window.external.SetHeaderText('<?php
echo utf8::encode_javascript(getOption('gallery_title'));
?>
','<?php
echo utf8::encode_javascript(FULLWEBPATH);
?>
');
}
<?php
echo $javascript;
?>
<?php
echo '</script></body></html>';
}
示例2: js_encode
/**
* encodes a pre-sanitized string to be used as a Javascript parameter
*
* @param string $this_string
* @return string
*/
function js_encode($this_string)
{
global $_zp_UTF8;
$this_string = preg_replace("/\r?\n/", "\\n", $this_string);
$this_string = utf8::encode_javascript($this_string);
return $this_string;
}