簡體   English   中英

在config.js文件中需要baseurl

[英]need baseurl in config.js file

在我的config.js文件(粘貼在下面)中,我需要獲取基本URL,但是我使用的php基本URL腳本不起作用。 關於我可以用來替換下面的php基本URL的任何建議?

BOBBIEEDITOR.editorConfig = function( config ) {
    config.fileopener = '<?php echo $this->baseUrl;?>files/browse.php?opener=bobbieeditor&type=files';
};

你能把$ this-> baseUrl的值放進去嗎? 以metas為例:

<!DOCTYPE html>
<html>
<head>
<meta name="data-base-url" content="<?php echo $this->baseUrl;?>" />

並使用JS獲取:

var base_url = document.querySelectorAll('head > meta[name="data-base-url"]');
var base_content = base_url[0].getAttribute('content');

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM