Load advanced jQuery version on page ready - javascript

My page is loaded with jQuery 1.4.4
On page ready I want to dynamically load jQuery 1.11.1
My question is: There is a way to load advanced version of jQuery (1.11.1) with current jQuery (1.4.4)?
I've tried to use jQuery.getScript() in order to dynamically load JavaScript files and it worked fine, but the only file that didn't loaded is the jQuery 1.11.1 version
I know how can I do it with native JavaScript code, but I want a cross browser solution so it have to be with using of the current jQuery (1.4.4).

You can use your version of jQuery independently via jQuery.noConflict() (docs).

Related

Load external TinyMCE plugin using jQuery TinyMCE

I use the TinyMCE jQuery plugin to assign TinyMCE to an input field (on document ready).
Now, I wrote a plugin for TinyMCE and want to load it.
The problem is, since the jQuery plugin loads the TinyMCE js file only when it's required, I can't just include my plugin js file since the "tinymce" object isn't loaded at this point.
How can I load my plugin at the right time?
Found it: There is a configuration option called external_plugins
https://www.tiny.cloud/docs/configure/integration-and-setup/#external_plugins

Colorbox not a method of object

I am fixing a bug on leefest.org.uk and I cannot get Colorbox working. Multiple people have worked on this project, so I apologise for the mess.
Their are multiple plugins with multiple document ready functions.
As far as I can work out:
jQuery is being loaded before colorbox
Colorbox is being loaded before the colorbox call
The colorbox call is within a document ready function
Anyone?
This could happen if jQuery was being loaded twice. The first version of jQuery would be extended with the colorbox plugin. Including jQuery again would replace the original instance, and would not include colorbox.
Most of the time I see this happening is when people load ajax content that includes a script element that sources the jQuery library, or they include a script in their main document that they do not realize has had jQuery included with it.

Html pages not loaded from application cache when used jquery .load('pageName') method

I am trying to implement the html5 offline cache feature of our html pages, it works fine for the jquery version 1.4.
But when i used the jquery 1.8, the problem arises for the html pages which i loaded by using the jquery method of load(). i.e;
$('#divName').load('htmlPageName')
{
// some functionailty
}
The HTML is not rendered. It seems all the pages are downloaded so, there is no issue in caching. Other pages work fine if we not used .load()
Give an extension of the htmlpagename and if you need callback function you can have $("#divName").load('htmlPageName','',myFunc);
and you can have whatever you want to achieve in this particular function
function myFunc(){
}

jQuery tabs is loaded but not working in WordPress

I am trying to work with jQuery UI tabs in WordPress but I keep getting the "jQuery("#").tabs is not a function" error.
I thought the tabs file might not be loading but looking in firebug it shows it is loading. I am also using modernizr so I thought there might be a conflict with that but using jQuery.noConflict(); did not solve the problem either. At first I used to load jQuery but for some reason it wouldn't work. Now I just linking directly to the files and they are loading.
If it helps, I am trying to get tabs working for this tutorial. The website I working on is lbk.newcoastmedia.com/wordpress
Thanks for any help!
I see the following scripts being loaded on your page:
modernizr-1.6.min.js
l10n.js
jquery.js
galleria.js
and
<script type="text/javascript">
jQuery(document).ready(function($){
$("#photo-rotator").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 4000);
});
</script>
$.tabs is an extension of jQuery UI, and I don't see jQuery UI or the tabs extension loaded on your page. Look at the very bottom of the source at your link and you'll see the following two scripts, which I believe are what you're missing.
ui.core.js
ui.tabs.js
Your debugger is alerting you that $.tabs is not a method because it really hasn't been defined yet.
Just had this problem on Drupal and resolved it by downloading a custom build of the jQuery UI library WITH Tabs selected. Apparently the default jQuery UI library that shipped with Drupal didn't have this module, so perhaps this is also the case with WP.

Inject jQuery, jQuery UI and plugins without version conflict

I would like to inject, via a bookmarklet, my own code into a web page.
That code needs jQuery, jQuery UI and some plugins to be added too in the web page.
I read about noConflict but what about if some jQuery plugins (with different version) are also loaded by the web page and they uses the same CSS class names or ids.
how must I proceed to inject all my code?
What kind of bookmarklet are you trying to inject. If you can open an iframe using your bookmarklet and show your content there like RTM, Springpad etc then I believe you won't have a problem.

Categories

Resources