Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
How to get the domain name for addon ? How to add string add footer ?
saturngod
New
I am writing plugin and I need to add domain name for plugin path in javascript file.
I want to add this string before .
I didn't find get domain name in vanilla 2 add on and add string before
<script>
keyboards = [
["http://www.saturngod.net/wp-content/plugins/jkeymagic/js/kb/Myanmar3.js", "Myanmar3"],
["http://www.saturngod.net/wp-content/plugins/jkeymagic/js/kb/Zawgyi L - Unicode.js", "Zawgyi L - Unicode"] ];
</script>
I want to add this string before .
I didn't find get domain name in vanilla 2 add on and add string before
Tagged:
0
Answers
You want add the domainname where?
I want to add
http://www.mydomain.com/plugins/jkeymagic/js/kb/Myanmar3.js
You just need to use: $Sender->AddJsFile('Myanmar3.js', 'plugins/jkeymagic/js/kb');
or use the full path $Sender->AddJsFile('plugins/jkeymagic/js/kb/Myanmar3.js');
because it's dynamic loading from other script.
You might found a function/method that does what you want.
$webroot=Gdn_Url::WebRoot();
if($webroot!="") {
$webroot=$webroot."/";
}
$domain=Gdn_Url::Domain();
$address=$domain."/".$webroot;