Kirby Kirby - 1 year ago 205
Javascript Question

My addthis toolbox JavaScript widget not present on mobile device

I'm using Ionic v1 and testing in Chrome (ionic serve) and View App (ionic upload).

I included this script in my index.html

<script src=""></script>

And added the directive.

<sn-addthis-toolbox class="addthis_custom_sharing"
title: thing.title,
url: 'https://myurl/' +,
description: 'Check out my thing.'
<a href class="addthis_button_email"></a>
<a href class="addthis_button_facebook"></a>
<a href class="addthis_button_twitter"></a>
<a href class="addthis_button_google_plusone_share"></a>

When viewing my ionic app in Chrome or firefox everything looks great. When i push to Ionic view my addthis buttons are missing. In Chrome Dev Tools, things look great with any responsive view or device.

Any direction would be helpful here. How would i see error messages in Ionic view?

Why is the js widget not working on mobile device?


EDIT: I added the https and that got things a step further. (thanks to adamdport)

Now seeing Failed to load file:// resource: NET ERR_FILE_NOT_FOUND


Uncaught TypeError: Cannot read property 'split' of null
at r (
at e.exports (
at o (
at HTMLDocument.onReady (

on addthis_widget.js line 2

FINAL EDIT and solution: The best way i learned to solve this problem was to hook up my Nexus 6p via usb, enable usb debugging, and

Answer Source

I resolved your original question regarding why your script wasn't loading: it involved your usage of // and switching between http and https. If your Ionic URL uses https://, the // in your script src will try to also retrieve your script using https, and it might not load.

Since you've edited, I've pointed out that file:// will only work on your local file system. If you try to reference it from a server, it will still try to load resources from the client's machine.

If you need further help, I'd suggest posting another question.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download