Topic on Extension talk:MobileFrontend

Disable some used scripts in mobile version, how to do that?

5
193.200.211.146 (talkcontribs)

Hello all, Well I have a java script to be inserted inside of some pages. It looks like:

<script src="/scripts/script.js"></script>

Is it possible to disable it in mobile version? (to remove it from the page code of mobile version?) - nomobile class of course doesn't work - it just hides elements!

Florianschmidtwelzow (talkcontribs)

How do you load the script? You schould consider using ResourceLoader, there you can specify the target of a module (mobile or desktop or both).

193.200.211.146 (talkcontribs)

I insert the script using other extension HTMLets (http://www.mediawiki.org/wiki/Extension:HTMLets). And this script is used on several pages, but I don't want this script to be at all on mobile version, that was a question ) Any ideas how can I disallow this script in Mobile version?

Florianschmidtwelzow (talkcontribs)

That looks crazy :) But i think (after a quick review) there is no easy way to do this. What does the script do? Maybe you can use an own extension to deliver the script with the resourceloader (where you can specify the targets, like desktop or/and mobile) :)

Fokebox (talkcontribs)

I know that it looks crazy ))) I use this script to insert divs with different height propely on the page. And I use it just on main page and some others. In mobile version there is no need for this script as I had written.

If I use extension:Gadgets for using this script will it be helpful to exlude it from mobile version?

And this script would not work if the name of the div where javascript is aplicable would be changed in Mobile version ). I don't know if it is possible to make it somehow

Reply to "Disable some used scripts in mobile version, how to do that?"