Hi,
is there a way to integrate an additional js-file without editing the header.
A look at for example the category-extension a special js-file is stored in the extension folder. But how is this integrated in the wiki?
regards mic
See this extension example:
http://www.mediawiki.org/wiki/Manual:Opening_external_links_in_a_new_win dow
IT uses an additional .js
-----Original Message----- From: mediawiki-l-bounces@lists.wikimedia.org [mailto:mediawiki-l-bounces@lists.wikimedia.org] On Behalf Of Michael Heyder Sent: Thursday, August 30, 2007 06:13 To: mediawiki-l@lists.wikimedia.org Subject: [Mediawiki-l] add new js.file
Hi,
is there a way to integrate an additional js-file without editing the header.
A look at for example the category-extension a special js-file is stored in the extension folder. But how is this integrated in the wiki?
regards mic
_______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Shah, Nikhil schrieb:
See this extension example:
http://www.mediawiki.org/wiki/Manual:Opening_external_links_in_a_new_win dow
IT uses an additional .js
-----Original Message----- From: mediawiki-l-bounces@lists.wikimedia.org [mailto:mediawiki-l-bounces@lists.wikimedia.org] On Behalf Of Michael Heyder Sent: Thursday, August 30, 2007 06:13 To: mediawiki-l@lists.wikimedia.org Subject: [Mediawiki-l] add new js.file
Hi,
is there a way to integrate an additional js-file without editing the header.
A look at for example the category-extension a special js-file is stored in the extension folder. But how is this integrated in the wiki?
regards mic
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Ok,
but I#m wondering in which way the category tree extension integrates the additional js-file, which is stored in the extension folder.
Without changing anything at the wiki (without localsettings?)
- mic
Extension:AddScriptCss http://www.mediawiki.org/wiki/Extension:AddScriptCss
Michael Heyder wrote:
Hi,
is there a way to integrate an additional js-file without editing the header.
A look at for example the category-extension a special js-file is stored in the extension folder. But how is this integrated in the wiki?
regards mic
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Use Mediawiki:Common.js on your wiki
On Aug 30, 2007, at 5:13 AM, Michael Heyder wrote:
Hi,
is there a way to integrate an additional js-file without editing the header.
A look at for example the category-extension a special js-file is stored in the extension folder. But how is this integrated in the wiki?
regards mic
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
If you want to be really slick about it, you could try adding the following to the article [[MediaWiki:Common.js]]
(function(){ var s = document.createElement('script'); s.src = "http://path/to/external/file.js"; document.getElementsByTagName('head')[0].appendChild(s); })();
This will dynamically create the equivalent of this:
<script src="http://path/to/external/file.js"></script>
To your the document head.
-- Jim R. Wilson (jimbojw)
On 8/30/07, Jim Hu jimhu@tamu.edu wrote:
Use Mediawiki:Common.js on your wiki
On Aug 30, 2007, at 5:13 AM, Michael Heyder wrote:
Hi,
is there a way to integrate an additional js-file without editing the header.
A look at for example the category-extension a special js-file is stored in the extension folder. But how is this integrated in the wiki?
regards mic
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Jim Wilson wrote:
If you want to be really slick about it, you could try adding the following to the article [[MediaWiki:Common.js]]
(function(){ var s = document.createElement('script'); s.src = "http://path/to/external/file.js"; document.getElementsByTagName('head')[0].appendChild(s); })();
This will dynamically create the equivalent of this:
<script src="http://path/to/external/file.js"></script>
To your the document head.
IIRC, According to a comment in the scriptalicious code, Safari 2 won't work with this, so you have to use the bad old document.write instead.
Haven't tested it myself.
According to a comment in the scriptalicious code, Safari 2 won't work with this
Yeah, I see what you mean. That's too bad :(
Well, I guess the most compatible way to do it then is this:
document.write('<script type="text/javascript" src=" http://path/to/external/file.js"></script>');
-- Jim
On 8/31/07, Jim Higson jh@333.org wrote:
Jim Wilson wrote:
If you want to be really slick about it, you could try adding the following to the article [[MediaWiki:Common.js]]
(function(){ var s = document.createElement('script'); s.src = "http://path/to/external/file.js"; document.getElementsByTagName('head')[0].appendChild(s); })();
This will dynamically create the equivalent of this:
<script src="http://path/to/external/file.js"></script>
To your the document head.
IIRC, According to a comment in the scriptalicious code, Safari 2 won't work with this, so you have to use the bad old document.write instead.
Haven't tested it myself.
-- Jim
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
A lot of the js problems in Safari 2 are much better in Safari 3, but I believe that's still beta and has other beta issues. It's my main browser these days.
Jim
On Aug 31, 2007, at 11:48 AM, Jim Wilson wrote:
According to a comment in the scriptalicious code, Safari 2 won't work with this
Yeah, I see what you mean. That's too bad :(
Well, I guess the most compatible way to do it then is this:
document.write('<script type="text/javascript" src=" http://path/to/external/file.js"></script>');
-- Jim
On 8/31/07, Jim Higson jh@333.org wrote:
Jim Wilson wrote:
If you want to be really slick about it, you could try adding the following to the article [[MediaWiki:Common.js]]
(function(){ var s = document.createElement('script'); s.src = "http://path/to/external/file.js"; document.getElementsByTagName('head')[0].appendChild(s); })();
This will dynamically create the equivalent of this:
<script src="http://path/to/external/file.js"></script>
To your the document head.
IIRC, According to a comment in the scriptalicious code, Safari 2 won't work with this, so you have to use the bad old document.write instead.
Haven't tested it myself.
-- Jim
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
Jim,
Does this method bypasses the browser's cache?
In other words, if one visits site X containing this code multiple times, does the browser use its cache to serve the file?
thanks, jld.
Jim Wilson wrote:
If you want to be really slick about it, you could try adding the following to the article [[MediaWiki:Common.js]]
(function(){ var s = document.createElement('script'); s.src = "http://path/to/external/file.js"; document.getElementsByTagName('head')[0].appendChild(s); })();
This will dynamically create the equivalent of this:
<script src="http://path/to/external/file.js"></script>
To your the document head.
-- Jim R. Wilson (jimbojw)
On 8/30/07, Jim Hu jimhu@tamu.edu wrote:
Use Mediawiki:Common.js on your wiki
On Aug 30, 2007, at 5:13 AM, Michael Heyder wrote:
Hi,
is there a way to integrate an additional js-file without editing the header.
A look at for example the category-extension a special js-file is stored in the extension folder. But how is this integrated in the wiki?
regards mic
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
I'm fairly certain that such an inclusion follows standard browser caching rules. I've seen this behavior from Ajax requests as well. Browsers tend to cache JS and CSS files pretty heavily, even (in my experience) those that are added to the DOM dynamically or requested via XHR's.
-- Jim
On 9/11/07, Jean-Lou Dupont jeanlou.dupont@gmail.com wrote:
Jim,
Does this method bypasses the browser's cache?
In other words, if one visits site X containing this code multiple times, does the browser use its cache to serve the file?
thanks, jld.
Jim Wilson wrote:
If you want to be really slick about it, you could try adding the
following
to the article [[MediaWiki:Common.js]]
(function(){ var s = document.createElement('script'); s.src = "http://path/to/external/file.js"; document.getElementsByTagName('head')[0].appendChild(s); })();
This will dynamically create the equivalent of this:
<script src="http://path/to/external/file.js"></script>
To your the document head.
-- Jim R. Wilson (jimbojw)
On 8/30/07, Jim Hu jimhu@tamu.edu wrote:
Use Mediawiki:Common.js on your wiki
On Aug 30, 2007, at 5:13 AM, Michael Heyder wrote:
Hi,
is there a way to integrate an additional js-file without editing the header.
A look at for example the category-extension a special js-file is stored in the extension folder. But how is this integrated in the wiki?
regards mic
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org