Viewing jQuery in V1.8.1

jQuery in V1.8.1



User: Roddy 10 years ago
Since I didn't have any problems with the original version 1.8, I took my own sweet time to download and install V1.8.1. What a disaster!

SInce I quite often don't get to use my own widgets because they weren't invented when the site was created, I used code insertion for a "back to the top button" and the tap to close the navigation drop downs on touch devices on over 500 pages of the EverWeb Codebox site.

Since previous versions of EverWeb inserted jQuery on every page, I didn't need to include the link and never thought to do so after opening these project files in 1.8.1 since they worked fine after opening in V1.8.0. The result was that every page of the site showed an error.

I fixed this on two sections of the site by deleting the code and using a modified version of my own widgets. This was fairly straight forward since these sections used master pages.

The earlier sections which were created before master pages were invented - so not so easy. My quick fix was to open them in V1.7.5 and republish.

jQuery is now in the ew_js folder and inserting a link to that in the site wide code box doesn't work if the site contains top level pages and directories. What is the answer fro those who created sites prior to V1.8.1 with objects which require jQuery and who may want to do so in the future?

Last edit 10 years ago

-------------------------------
Roddy

Website: http://everwebwidgets.com
Contact: http://everwebwidgets.com/ewWidgets-home/contact.html
NOTE: I am an EverWeb user and NOT affiliated with EverWeb! Any opinions expressed in this forum are my own.
User: Roddy 10 years ago
I'm kind of answering my own question here.

If you have inserted the code for an object requiring jQuery in every page of the site - and the site has both top level pages and directories - the link to jQuery cannot be inserted into the site wide code box.

It needs to be inserted in the page inspector code box like this for top level pages...

<script type="text/javascript" src="ew_js/jquery.min.js"></script>

... and this for pages in directories...

<script type="text/javascript" src="../ew_js/jquery.min.js"></script>

Now you can see why I did the "quick fix" of reverting to V1.7 rather than insert code into over 500 pages!

-------------------------------
Roddy

Website: http://everwebwidgets.com
Contact: http://everwebwidgets.com/ewWidgets-home/contact.html
NOTE: I am an EverWeb user and NOT affiliated with EverWeb! Any opinions expressed in this forum are my own.
User: Paul-RAGESW 10 years ago
I don't think there were any changes regarding jQuery in 1.8.1 over 1.8. There were changes for 1.7.5.

I think you can use this code it will work because it will always access the global js folder.

<script type="text/java script" src="{!-JSRELPATH-!}jquery.min.js"></script>

But if you use this code in the footer it should work to only load jQuery if it hasn't been loaded before.
if (typeof jQuery == 'undefined')
{
document.write(unescape("%3Cscript src='URL TO JQUERY' type='text/javascript'%3E%3C/script%3E"));
}

Make sure to wrap it in script tags.

I haven't tested this though

You should update your widgets to use the useJquery tag.

Quote:
jQuery is now in the ew_js folder and inserting a link to that in the site wide code box doesn't work if the site contains top level pages and directories. What is the answer fro those who created sites prior to V1.8.1 with objects which require jQuery and who may want to do so in the future?


jQuery is only in this folder as a backup incase it cannot be loaded from Google's CDN BTW.

-------------------------------
Paul
EverWeb Developer
User: Roddy 10 years ago
Quote:
You should update your widgets to use the useJquery tag.


All the widgets work fine and I have used the new tag in widgets that will only work in 1.8 and up.

The problem arises when users insert raw code.

For example, a lot of people have downloaded the script for this mobile two level navigation. This was published a while back before I created a widget to do the same kind of thing but better.

There are a gazillion projects out there that use jQuery plugins and instructing users to use a link to a certain version of jQuery. I've had quite a few emails from users trying to implement slideshows and such like using raw code and getting stuck due to referrencing a conflicting version of jQuery.

I suppose I should delete large chunks of the section of the site which is concerned with code insertion - or perhaps the whole thing?. It was created when there was just a handfull of widgets.
It does seem to help quite a few people but not so good for those who don't actually read the instructions and make changes without having a clue as to what they are doing.

-------------------------------
Roddy

Website: http://everwebwidgets.com
Contact: http://everwebwidgets.com/ewWidgets-home/contact.html
NOTE: I am an EverWeb user and NOT affiliated with EverWeb! Any opinions expressed in this forum are my own.
User: Paul-RAGESW 10 years ago
Quote:
I suppose I should delete large chunks of the section of the site which is concerned with code insertion - or perhaps the whole thing?. It was created when there was just a handfull of widgets.
It does seem to help quite a few people but not so good for those who don't actually read the instructions and make changes without having a clue as to what they are doing.


Yes I understand it is frustrating but we need to make improvements. Sometimes when we do that it may break old code, especially when using code insertion. If we didn't, we wouldn't be able to add great new features.

Sorry for the inconvenience.

-------------------------------
Paul
EverWeb Developer


Post Reply
You must login or signup to post.