Bookmarklet Error (Chrome, Firefox)

Travel Forums System Talk Bookmarklet Error (Chrome, Firefox)

1. Posted by katebum (Budding Member 118 posts) 3w Star this if you like it!

Hi Peter,

just wanted to use the Bookmarklet as ever done before... but it's not longer working.

I tested:

MacOS: 10.14.1
Firefox: 63.0.3
Chrome: 70.0.3538.102

Firefox:
TypeError: $(...).parents(...).andSelf is not a function[Weitere Informationen] bookmarklet.js:97:22
$.fn.ogp/< https://tp.daa.ms/js/bookmarklet.js:97:22
each https://code.jquery.com/jquery-3.3.1.min.js:2:2571
each https://code.jquery.com/jquery-3.3.1.min.js:2:1238
$.fn.ogp https://tp.daa.ms/js/bookmarklet.js:96:11
<anonym> https://tp.daa.ms/js/bookmarklet.js:166:18
<anonym> https://tp.daa.ms/js/bookmarklet.js:2:35
<anonym> https://tp.daa.ms/js/bookmarklet.js:1:2

Chrome:
bookmarklet.js?r=32967154.123234157:97 Uncaught TypeError: $(...).parents(...).andSelf is not a function
at HTMLHeadElement.<anonymous> (bookmarklet.js?r=32967154.123234157:97)
at Function.each (jquery-3.3.1.min.js:2)
at w.fn.init.each (jquery-3.3.1.min.js:2)
at w.fn.init.$.fn.ogp (bookmarklet.js?r=32967154.123234157:96)
at bookmarklet.js?r=32967154.123234157:166
at bookmarklet.js?r=32967154.123234157:2
at bookmarklet.js?r=32967154.123234157:15
(anonymous) @ bookmarklet.js?r=32967154.123234157:97
each @ jquery-3.3.1.min.js:2
each @ jquery-3.3.1.min.js:2
$.fn.ogp @ bookmarklet.js?r=32967154.123234157:96
(anonymous) @ bookmarklet.js?r=32967154.123234157:166
(anonymous) @ bookmarklet.js?r=32967154.123234157:2
(anonymous) @ bookmarklet.js?r=32967154.123234157:15

2. Posted by katebum (Budding Member 118 posts) 3w Star this if you like it!

It's working fine on your domain:
https://www.travellerspoint.com/

But on other domains it stops working.

3. Posted by katebum (Budding Member 118 posts) 3w Star this if you like it!

The same in Safari 12.0.1

TypeError: $(this).parents().andSelf is not a function. (In '$(this).parents().andSelf()', '$(this).parents().andSelf' is undefined)
(anonyme Funktion) — bookmarklet.js:97
each — jquery-3.3.1.min.js:2:2578
ogp — bookmarklet.js:96
(anonyme Funktion) — bookmarklet.js:166
(anonyme Funktion) — bookmarklet.js:2
Globaler Code — bookmarklet.js:15
https://www.geocaching.com/account/scripts/custom/message-center-header-widget.js.map

4. Posted by Peter (Admin 6611 posts) 3w Star this if you like it!

Can you point me to a page where I can test it and have it fail? It worked ok in the pages I tested.

5. Posted by katebum (Budding Member 118 posts) 3w Star this if you like it!

Example:

https://www.geocaching.com/geocache/GC4RRR7_185-empty-chairs-christchurch
https://nomadmania.com/profile/573/un

and all other pages I have tested so far... only travellerspoint is a working domain

6. Posted by Peter (Admin 6611 posts) 3w Star this if you like it!

It's to do with there being an existing version of jquery in the page.

To avoid loading two versions of jquery, the bookmarklet will use the version on the page. Problem is that the andSelf function was was removed from newer versions. Both the pages you linked to have this new version of jquery. I'll see what I can do about it. At the very least I can probably avoid using that old function.

7. Posted by katebum (Budding Member 118 posts) 3w Star this if you like it!

Great you find the issue so fast! Hope it's easy for you to fix it

8. Posted by Beausoleil (Travel Guru 844 posts) 3w Star this if you like it!

I use Chrome and am having no trouble with the bookmarklet. It's one of my favorite features of TP.

9. Posted by Peter (Admin 6611 posts) 2w Star this if you like it!

This problem should be fixed now and handle those sites with newer versions of jquery on them.

10. Posted by katebum (Budding Member 118 posts) 2w Star this if you like it!

Problem is fixed!

Great work Peter!

Kate