external-script

Javascript external script loading strangeness

半城伤御伤魂 提交于 2019-12-01 14:58:29
I'm maintaining a legacy javascript application which has its components split into 4 JS files. They are "Default.aspx", "set1.aspx", "set2.aspx" and "set3.aspx". The ASPX pages writes out compressed JS from multiple (all-different) source files belonged to their respective set and set content-type header to "text/javascript". The application is invoked by adding a reference to the first set and creating the main entry object. <script src="/app/default.aspx" type="text/javascript"></script> <script type="text/javascript> var ax; // <body onload="OnLoad()"> function OnLoad() { ax = new MyApp

Javascript external script loading strangeness

让人想犯罪 __ 提交于 2019-12-01 13:20:02
问题 I'm maintaining a legacy javascript application which has its components split into 4 JS files. They are "Default.aspx", "set1.aspx", "set2.aspx" and "set3.aspx". The ASPX pages writes out compressed JS from multiple (all-different) source files belonged to their respective set and set content-type header to "text/javascript". The application is invoked by adding a reference to the first set and creating the main entry object. <script src="/app/default.aspx" type="text/javascript"></script>

How to load third-party javascript tag asynchronously which has document.write

不问归期 提交于 2019-11-30 17:53:28
We give out a piece of javascript tags such as <script src="http://ours.com/some.js"></script> which site owners put on their site like http://example.com and in this javascript tag we want to dynamically include a third-party js such as which can have document.write in it, but of course if we try to include it by conventional method, var script_tag = document.createElement('script'); script_tag.type = 'text/javascript'; script_tag.src="http://third-party.com/some.js"; document.getElementById('target').appendChild(script_tag); we get a warning from browser, Warning: A call to document.write()

How to get current Joomla user with external PHP script

拟墨画扇 提交于 2019-11-29 07:38:44
I have a couple PHP scripts used for AJAX queries, but I want them to be able to operate under the umbrella of Joomla's authentication system. Is the following safe? Are there any unnecessary lines? joomla-auth.php (located in the same directory as Joomla's index.php): <?php define( '_JEXEC', 1 ); define('JPATH_BASE', dirname(__FILE__)); define( 'DS', DIRECTORY_SEPARATOR ); require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' ); require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' ); /* Create the Application */ $mainframe =& JFactory::getApplication('site'); /* Make sure we are

How to get current Joomla user with external PHP script

非 Y 不嫁゛ 提交于 2019-11-28 01:13:56
问题 I have a couple PHP scripts used for AJAX queries, but I want them to be able to operate under the umbrella of Joomla's authentication system. Is the following safe? Are there any unnecessary lines? joomla-auth.php (located in the same directory as Joomla's index.php): <?php define( '_JEXEC', 1 ); define('JPATH_BASE', dirname(__FILE__)); define( 'DS', DIRECTORY_SEPARATOR ); require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' ); require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php'