Tips and tricks

So recently I had to make ajax requests that pull in a piece of page with some scripting inside. The context does not matter much, what matters is the script executed fine on my localhost but not as a WordPress installation in a WP blog. After some head banging turns out that in my localhost I was using jQuery 1.9.1 and WP uses 1.8.3 .
So jQuery 1.9.1 seems to find the script tags too in the pulled ajax content. But what interests me is the WP plugin functionality. I could deregister the 1.8.3 and register the 1.9.1 but that is a very very bad practice. So I prefer a dirty approach better then a bad practice that could damage others.
I wrap my script in a invisible div like so
jQuery(document).ready(function($){ var videoplayersettings = { autoplay : "off" ,videoWidth : "100%" ,videoHeight : 300 ,constrols_out_opacity : 0.9 ,constrols_normal_opacity : 0.9 ,settings_hideControls : "off" ,design_skin: "skin_aurora" ,responsive: "on" }; $('#vphistory').vPlayer(videoplayersettings); })
Then in the javascript just do
jQuery('.toexecute').each(function(){ var _t = jQuery(this); if(_t.hasClass('executed')==false){ eval(_t.text()); _t.addClass('executed'); } })
at the end of the document and at the end of each complete ajax request.
I loved as much as you’ll receive carried out right here. The sketch is tasteful, your authored subject matter stylish. nonetheless, you command get got an impatience over that you wish be delivering the following. unwell unquestionably come more formerly again since exactly the same nearly a lot often inside case you shield this hike.
This post contain a lot of information about recent wheel of events.i hope this article will be helpful for the reader’s.thank you very much for sharing with us.
I simply want to mention I am beginner to blogging and really enjoyed this web site. Almost certainly I’m want to bookmark your website . You surely have impressive stories. Appreciate it for sharing your webpage.